Rotating sprites from a spritesheet

This forum is currently in read-only mode.
From the Asset Store
Build your map with these isometric objects and terrains
  • Hey there,

    I have been experimenting with spritesheets lately, but from where I stand today, I would say that "messing around" would be a more appropriate term.

    THIS is what I did, and also UV-offsetting works now.

    However, I fail to establish a working technique to stick the spritesheet to another object, let`s say a sprite, that I can freely rotate (probably due to it`s quad nature).

    I tried to give a sprite the TiledBackground`s texture with TextureSetter, but of course this implies the whole sheet and not only the cutout I?ve set on the TiledBG. Applying a pixel shader to offset, rotate and zoom the cutout results in an utter mess.

    My next shot would be to write and apply a vertex-shader that does the job, UNLESS there`s somebody out there that knows how to overcome the problem.

    And yeah, I thought of firing up the sheet to ImageManipulator, do a cropping loop and write the cutout to a sprite, but the loop is ... not that quick.

    So, anyone? <img src="smileys/smiley2.gif" border="0" align="middle">

    Cheers,

    the Colonel

  • Use a Sprite instead of tiledBackground and use the displacement actions.

    http://dl.dropbox.com/u/5426011/examples14/uv_spritesheet.cap

  • OMGIAMSOSTUPIDFORGIVEMEMASTER!!!oneoneone

    I was so furiosly spritesheeting that I forgot about the d-maps.

    Thanks alot R0J0!

  • Oh oh... when you try to address several sprites, the relative displacement doesn`t work, as if it was ignored for each instance beyond the first. You can verify this if you just copy the sprite several times in your example.

    What now?

  • It's working here, I added more instances and they still worked as intended. If you create them at runtime you need to set the distort map size before displacement will work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Jeez... sometimes I really wonder how I came this far. After applying the distort map, it of course works. Thanks again!

  • Update: Everything is in order now, one thing that I came accross was that the position of the pivot point of the cut-out sprite is related to the original sheet-size, however, the position of the sprite in Construct, is not.

    That means to center the pivot point on a 128x128 sprite of your 2048x2048 spritesheet, simply putting the point to 64x64 won�t do it, you find the center point by applying (sheet width/sprite width)+(sprite width / 2). Same goes for height.

    Cheers,

    The Colonel

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)