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 - m4ko

Pages: 1 2 [3]
31
Releases / Re: 2D Toolkit 1.91 final + patch 1
« on: March 15, 2013, 10:54:50 am »
That was quick. Thank you!

32
Support / Re: Hourglass
« on: March 15, 2013, 10:30:37 am »
The clipped sprite works quite nice for this! Thank you very much.

Example for reference:
1. Make the "Sand in bottom of the hourglass" sprite a "clipped sprite"
2. Set the Clip Region height to 0
3. In the script do the following to make the sand gain/pile up 10% in the hourglass:
Code: [Select]
SPRITE.ClipRect = new Rect(SPRITE.ClipRect.x, SPRITE.ClipRect.y, SPRITE.ClipRect.width, SPRITE.ClipRect.height + 0.1f);
Amazingly simple code. This should work perfectly fine for many "progres bar" like objects. Even "round edged" progress bars.

Also this would make a fine solution to the barber pole example. Just move the sprite top-bottom and right-left while clipping the desired boundaries at the same time.

33
Same here. Even happens in a fresh/empty project.

Create Project
Import tk2d
Import 1 PNG
Create SpriteCollection
Commit -> The aforementioned exception comes up

34
Support / Re: Hourglass
« on: March 14, 2013, 02:18:55 pm »
I got it working using a second camera and the clipping feature. It's a little complicated for such a simple thing (2 extra cameras, one for growing bottom up and one for shrinking downwards) and the positioning of the cameras when attached to a gameobjects is awkward.

Example:
Gameobject Pos: 600, 230, -5
     Sprite Pos: -25, 9, 0   (Child of Gameobject, Totals to 575, 239, -5)   <- hidden for normal camera. it sits in the transparentfx layer.

Then I attach the clipping camera (which only shows TransparentFX) to the gameobject because I want to make it a prefab with attached script that will increase/decrease the clipping cameras Region.height to simulate an increase/decrease in sand through its clipping.

I then need to set the transform.position of the camera to -600, -230 and the Viewport Clipping to 575, 239.

The problem with that is: If I decide to move the whole gameobject (repositioning the clock) then the clip camera will stick. It will not move with the gameobject. This makes layout horrible. Especially with multiple cameras.

Am I doing something wrong? Is there a better way?


Next idea:
I will try the newest beta with "sprite hard clipping" as soon as an admin completes my registration.

35
Support / Hourglass
« on: March 14, 2013, 12:39:41 pm »
Hi,

I am trying to make a 2D hourglass but I am a little lost. Currently I have the following sprites:
Hourglass Front
Hourglass Back
Sand Top
Sand Bottom

My plan was to just layer these front > sand top, sand bottom > background. This works quite well.

The problem is when I want to "substract" from the top pile and "add" to the bottom. The only thing that comes to mind is scaling those textures (top y shrinks downwards, bottom y grows upwards). However an hourglass is pretty angled. Therefore: The top sand will "break out of the glass" while the bottom part fills up in the center and never reaches its sides until its at 100%. It is not possible to just cover up this mess because there are no sprites allowed to the sides of the hourglass.

Is it possible to instead of scale the sprite just draw a specific part of it? If the sprite is 100x100 pixels. Can I draw 100x80 of it? I think that would look much better. Or is it possible to add a mask to the sprite? So that it could just be a square which is masked on the sides of the hourglass?

Or if you have any other ideas on how to fill angled sprites with fluids/sand/etc. throw in your ideas please.

36
Support / Re: Sprite Dimensions
« on: March 11, 2013, 03:47:44 pm »
Thanks for the fast response. You were right. I forgot about the "use tk2d camera" setting. That is why my scale was off on the sprites. The GetBounds function now gives me perfectly fine sprite dimensions by using SPRITE.GetBounds().size.x.

Thank you very much.

37
Support / Sprite Dimensions
« on: March 11, 2013, 03:14:11 pm »
Hello,

I have a problem regarding initial setup (i guess). I am using the tk2dCamera. When i insert a sprite and click on 1:1 in scaling it sets its scale to 270,270,270.

I guess that is not correct? At least I can't find out how to get the actual dimensions of a sprite (GetBounds) as the results are off. Sprite.width would be nice to have.

Camera settings:
http://imageshack.us/photo/my-images/713/camerau.png/

Sprite settings:
http://imageshack.us/photo/my-images/715/inspector.png/

38
Support / Re: Flash compatibility
« on: March 11, 2013, 10:18:34 am »
Thank you for the fast answer. We will be buying 2d toolkit then :)

39
Support / Re: Flash compatibility
« on: March 11, 2013, 08:52:53 am »
Hello 2d toolkit community,

Sorry for necroing this topic but it is the second hit when searching google for "2d toolkit flash export" so I guess it would be useful to update the status on flash.

So are there any news on flash support?

Pages: 1 2 [3]