Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Velvety

Pages: 1 [2]
16
Support / Re: tk2dCamera.ScreenExtents incorrect when ZoomFactor not 1?
« on: August 21, 2013, 03:44:02 pm »
Thanks, you are right it does work in your package.  After seeing that I did some more digging.  My problem may have something to do with how I am trying to constrain my camera within bounds.

Here is what I'm doing and what I've found:
1. In my Update() loop I process my mouse scrolling and zoom the camera ZoomFactor accordingly
2. After zooming I immediately check my bounds and correct the camera if it is outside of the bounds (when I do this all the calculations seem correct and the camera should be correctly adjusted. I even create a cube with the camera extents at this point to visually see that it is within the bounds - looks correct)
3. Shortly afterwards something calls tk2dCamera.OnPreCull() and that calls UpdateCameraMatrix() which changes the camera extents.  This changes the camera to display areas outside of my bounds. I am not sure what is causing this, any insights into that?

17
Support / tk2dCamera.ScreenExtents incorrect when ZoomFactor not 1?
« on: August 21, 2013, 05:20:46 am »
I'm not sure if I am missing something here or if there is actually a problem.  I am changing my tk2dCamera.ZoomFactor to zoom in and out of my scene. This works fine.  I am also moving my tk2dCamera position around to pan the scene.  This also works fine.

But when I use tk2dCamera.ScreenExtents to keep the camera within a bounds I am running into a problem.  tk2dCamera.ScreenExtents seem to be correct when my ZoomFactor is 1.  However, when I zoom in or out (ZoomFactor becomes something like 0.625 or 1.25, etc) the tk2dCamera.ScreenExtents no longer seems accurate and my bounds are not restrained correctly.

I've tested this by creating a cube with the same size of the ScreenExtents and positioning it center with the camera. At ZoomFactor 1 the tk2dCamera.ScreenExtents returns 16 width x 12 height and a cube of the same size matches the camera bounds I see in the editor's scene view.  But if my ZoomFactor is 0.625 tk2dCamera.ScreenExtents returns 21.33 width x 16 height and this does NOT match a cube of the same size.  A cube closer to 25.6 x 19.2 looks accurate.

Am I missing something fundamental here or is tk2dCamera.ScreenExtents not returning the actual correct size of the camera bounds?

18
Support / Re: How to set draw/render layer of sprites?
« on: August 19, 2013, 12:33:38 am »
Ah that makes sense.  I have been reading the v2.2 documentation here (http://www.unikronsoftware.com/2dtoolkit/docs/2.20/html/classtk2d_sprite.html) because I just bought 2DToolkit and assumed it was the most recent one in the docs (I actually have v2.1).

I will checkout the v2.2 beta now, thanks!

Are there any known issues with the beta?


19
Support / How to set draw/render layer of sprites?
« on: August 18, 2013, 11:26:29 pm »
Hi,

I've recently started using 2DToolkit.  I am converting an older code base of mine that used Sprite Manager 2.  I'm trying to figure out how to render sprites ontop/behind each other with 2DToolkit without manually setting the z position of the sprite transforms.  SM2 had a "drawlayer" property to handle this on its sprites.  I see in your script reference that the tk2dSprite class is supposed to have a RenderLayer property that sounds like it would do the same thing.  However, this property does not actually exist in that class when I look.  How come it is missing?  Is there some other way to handle the order that sprites are rendered in?

Thanks, really liking 2DToolkit so far.

Pages: 1 [2]