2D Toolkit Forum
2D Toolkit => Support => Topic started by: sturmburg on April 29, 2013, 02:12:03 pm
-
Hi,
New to 2D toolkit and had a question about backgrounds in a side-scroller. If I have a single image I want to use as the background, what is the most efficient way of displaying it?
thanks for any info.
-
The most efficient way to do this is likely to use runtime sprite collections. Check sample #13 for more info on how that works. This is to avoid having to create an atlas or anything else.
-
hi!
i get a issue with my background. The background over pose to my sprite when play the game prototype.
The Z axis of my sprite "the wall Stone" is 10.80086
The Z axis of my background is 52.88598
The camera i use is default of unity, Perpestive view
Soo...don't get what the problem here.
Can help me pls?
Thanks!
-
Well you didn't say you used a perspective camera :)
Have you tried calling MakePixelPerfect on the sprite after you create it?
-
thanks for reply to soon :)
I am in my work now, in the night i see the MakePixelPerfect is check o create.
This issue only happen in 2D toolkit 2.0 not in 1.9 version.
Unikron...can you says what camera is more recommended for game 2D?
In my case i use camera default of Unity and perspective, because i get a parallax effect whit my background and my sprite on front.
can you?
-
If you want to use a parallax camera, thats fine, but you just need to call MakePixelPerfect once. The checkbox is not present in tk2d 2.0, but all you need to do is click "1:1". As long as you don't move it in z then it will always be fine :)
-
yep..clik the 1:1 is a option to solved this problem...but destroy all scale of my sprite.
So for now a set the camera the "far" value to more!
Thanks!
-
Hi,
I'm also new to 2D toolkit. If I have a single image I would like to use for my background, how do I set it up?
Thanks.
-
In 2D Toolkit 2.0, select the background image in project window, and in hierarchy window, Create > tk2d > Sprite from selected texture. Set up the camera settigns and you're good to go.
-
And there is a way to resize the background to it's original size?
My background is 1280x720 (My camera also has this size)... But when I create a sprite from it, I got a 1024x512 texture.
How to resize it easly to it's original size and make it fits all my camera view?
-
And why it's create on my scene a Sprite and a tk2dSpriteFromTexture - background01?
I must keep both?
-
Yes. One of them is the sprite collection. It gets deleted when the sprite is deleted.
-
And the other question about the Original Texture vs Sprite Size? :)
I must be doing something very wrong!
-
That sounds very much like your texture importer setting is set to "Texture" and not "GUI". Set it to GUI or manually enable non-power of two textures for it to be the correct size.