Clipping features?
by NEOK · in Torque Game Builder · 12/06/2005 (12:40 pm) · 3 replies
I'm still a newbie to T2D.
I just want to that how to implement clipping features with T2D objects.
I'm looking through T2D alpha 1.1 reference files, but couldn't find it yet.( precisley, couldn't find which object do.)
Suppose I have (100 width,80 height)world and a (10 width,10 height)sprite which is only seen in the restricted area(-20,-20,20,20).
The sprite is moving and it should be partly displayed while it is on the edge of the restricted area.
Is there any appropriate feature like a clipping area or a sized layer in this situation or should I do some trick with 2 bg sprites?
Otherwise, recommend any demo giving some idea please. Thanks.
I just want to that how to implement clipping features with T2D objects.
I'm looking through T2D alpha 1.1 reference files, but couldn't find it yet.( precisley, couldn't find which object do.)
Suppose I have (100 width,80 height)world and a (10 width,10 height)sprite which is only seen in the restricted area(-20,-20,20,20).
The sprite is moving and it should be partly displayed while it is on the edge of the restricted area.
Is there any appropriate feature like a clipping area or a sized layer in this situation or should I do some trick with 2 bg sprites?
Otherwise, recommend any demo giving some idea please. Thanks.
About the author
#2
12/06/2005 (2:58 pm)
Another option here is to have another t2dSceneWindow at the coordinates you specify. It will get clipped independent of the rest of your other fullscreen scenewindow. I frequently use two scenewindows: one for my game and one for my UI. That way I can pan and zoom my game without worrying about my UI/HUDs moving or scaling.
#3
I haven't added a per-object clipping ability to T2D, primarily because it's never been asked for and/or has limited use. That's not to say it couldn't be done or won't.
It's relatively simple to add but the conversions, per-object, of world-space to screen-space coordinates would take-up a little processing, especially if multiplied over lots of objects.
If you wanted to add this yourself, have a look at the "t2dTileLayer" object. In the non-rotated render function, there's a bit of code at the start that configureds a clipping-window so that tiles only get rendered to the bounding-box. This is essentially what you want but with specified coordinates.
- Melv.
12/06/2005 (11:22 pm)
Neok,I haven't added a per-object clipping ability to T2D, primarily because it's never been asked for and/or has limited use. That's not to say it couldn't be done or won't.
It's relatively simple to add but the conversions, per-object, of world-space to screen-space coordinates would take-up a little processing, especially if multiplied over lots of objects.
If you wanted to add this yourself, have a look at the "t2dTileLayer" object. In the non-rotated render function, there's a bit of code at the start that configureds a clipping-window so that tiles only get rendered to the bounding-box. This is essentially what you want but with specified coordinates.
- Melv.
Torque 3D Owner Stephen Zepp