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.


Topics - VeTaL

Pages: [1]
1
Support / Simplest way to draw a line.
« on: May 12, 2012, 02:03:34 pm »
Its me again :)

Now i'm trying to draw a line, using 2dtools.

* This morning i tested Vectrocity, but it failed because of cameras.
* Some minutes ago, i tried to draw a line with Shuriken particles system, it also failed. Possibly, because of coordinate system. Tried to get coordinate of anchor and draw a line between 2 anchors - it failed also.
* Now i tried to draw line with Debug.DrawLine(), but i still see nothing.

Any recommendations, where to look?

2
FAQs / Font transparency
« on: May 12, 2012, 11:09:12 am »
Tried
textHero.color.a = 10;

but it is not possible to set value this way.

3
Support / FinishLoad event?
« on: May 12, 2012, 10:24:14 am »
Is it possible to have such kind of event? As i told before, i have lots of quite heavy animation. I'd like to know, when it loads completely (to show a loading screen, or so).

4
Support / Get current frame?
« on: May 12, 2012, 07:51:28 am »
Looked through reference for AnimatedSprite, found void tk2dAnimatedSprite.SetFrame(int currFrame   )   
http://unikronsoftware.com/2dtoolkit/doc/html/classtk2d_animated_sprite.html

But how to get current frame? For example, i need forward and backward animation. How can i reverse it?

Something like
Code: [Select]
if (Input.GetMouseButtonDown(0))
{
frameCurrent = anim.GetFrame();
anim.PlayFromFrame("Forward",frameCurrent);
}
if (Input.GetMouseButtonDown(1))
{
frameCurrent = anim.GetFrame();
anim.PlayFromFrame("Reverse",frameCurrent );
}

Kinda this:
Left Mouse Button - 0-1-2-3-4-5- Right Mouse Button - 5-4-3-2-1-0-30-29-28-27 - Left Mouse Button - 27-28-29-30-0-1-2- ...

PS: ideally, i think something like field Reverse should do all this stuff.

5
This is not a huge issue, though, i think you're interested in it.

I have number of sprites Sprite_001.png - Sprite_300.png.
They are split into different folders: Sprite_001.png - Sprite_070.png are in Stand folder, Sprite_071.png - Sprite_150.png are in Walk folder and so on.

I create new Sprite Animation, select Walk collection, and is shows first sprite with number Sprite_086.png, not Sprite_071.png.
As i said, not a huge issue, but still unpleasant.

6
Support / tk2d camera, empty screen
« on: May 11, 2012, 12:29:02 am »
Greetings

I have a problem: while using tk2d camera, i see only background. I found http://unikronsoftware.com/2dtoolkit/forum/index.php?topic=58.0 this topic and decided to start from the clear level.

Quote
tk2dCamera mini-tutorial.

1. Create sprite collection / font, and make sure you tick "Use tk2d Camera". You will not need to set up ortho size / height as you'd normally need to. Set up as usual, and don't forget to commit.
2. In the scene, delete the Main Camera, and "Create/tk2d/Camera"
3. Create a sprite as usual - if you set up the sprite collection as in step 1, it will automatically be pixel perfect, always. Otherwise, click "1:1" to make other sprites pixel perfect. You may need to click commit on your sprite collections again for this to work properly. You will see an error in the log if this is the case.

tk2dCamera Anchor mini-tutorial.

1. Click on the camera created above, and "Create Anchor". You will have an anchor object as a child to this camera.
2. Select this anchor object, and set it up as you like - offset is the offset from the anchor. For instance if your anchor wants to be 5 pixels in from the bottom right, simply select "BottomRight" as anchor, and set offset to -5, 5 (5 pixels in horizontally, 5 pixels up).
3. Create sprites as children to this object (simply select the object, and "Create/tk2d/Sprite" will automatically parent them and these objects will now automatically be anchored.

So, i created blank level, ran through all needed collections (actually, at this moment i need only 1 collection with 45 sprites) and set there "tk2d camera", then commited. atlas0.png weights 2.5 Mb, is that okay?

Then i added camera, added anchor, parented animated sprite to anchor... and see just blank screen.

PS: also, not object is not visible by editor camera (before, it was visible).

Pages: [1]