Hello Guest

Author Topic: Quick question about controllers and sprites  (Read 4025 times)

khelegond

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Quick question about controllers and sprites
« on: April 10, 2013, 02:24:41 pm »
Hello there - two-part question, probably quick to you guys :)

1) I have my character sprites (that I successfully turned into an animation). Also have my tiles (for the map). However... what is the "proportion" between the images and the sprites? What I mean is, I got an image that is 138x138px, but when I turn it to a sprite it has a 4.000082 something of width. I don't want to keep playing with the scale to get it right... or is that what I should do?

2) Anyone knows any good character controller for a 2D plataforming-style game? I'm having a really hard time getting a controller to work right. I would love 2D-Toolkit to have a few example-projects :/

Thanks a lot for the (coming) answers ;)

Cheers,
Andr

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Quick question about controllers and sprites
« Reply #1 on: April 12, 2013, 12:34:15 am »
1. You set up the scale so it displays at 1:1. The size has little to do with the scale - all sizes will be proportionate though. The size of a "pixel" in a sprite is stored in sprite.CurrentSprite.texelSize.
If you want to think in pixels, then just use the tk2dCamera. It makes the sprites big - each pixel in the sprite will be one world unit, so a 123x123 px sprite will be 123x123 world units. Might just solve your problem here.

2. Some example projects are coming (after 2.0 is out), but as I explained to a previous request for game samples - everyones needs are different. The first few samples aren't going to interest you if you're only interested in platform games...