Jump to content

Positioning Issues


lmfielding
 Share

Recommended Posts

I have spent quite a few weeks on a few problems without asking for assistance but I feel that it is going to take me much longer to work out on my own so I request your help. :) Thank you!

 

I want to place a sprite in the middle of the screen (square rotated 45 degrees)

I want to place sprites next to this sprite in the middle of the screen so that they are aligned with no gaps

I want to check where there are missing tiles (in relation to the centre (initial) sprite

 

Most of my problems seem to be caused by the dimensions of the sprites changing based on outside circumstances (flexbox etc or initial dimensions not set on a SSR, irrelevant really).

I have achieved a lot of this in varying ways but it seems hacky.

Once I set the initial sprite, I have to change the pivot and position before or after rotation (can't remember) which causes a lot of problems because a square's width is no longer the same once you rotate it 45deg...

------

I feel that I need to cleanly set the rotated sprite (square) to the center of the screen, then add the rest of the sprites RELATIVE to this one, rather than from trying to calculate screenWidth, worldWidth, etc.

Please help before I make a horrible mistake by switching to phaser!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...