isometric tile setup
i have a 2D array of tiles, and each tile is 32x32 pixels.
im using this function to convert a normal 2d grid to an isometric view but im not getting an unform grid in return. (0,0 is the top left)
11 Replies
⌛
This post has been reserved for your question.
Hey @asdru! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
this is en example tile texture
those cubes don't look isometric
the angles aren't 45 degrees
So if you're trying stuff based on isometric measurements it won't work
plus because you're overlapping you need to get your drawing order right
adjusting the position made it work
Cute though 🙂
Always liked the voxelly pastel look
this is the new function
but as u can see from the image the tiles arent perfectly aligned due to float multiplication. so instead of getting 48 i get 47 for example. is there a way to get the right value?
thanks :)
yeah, don't just truncate but round
should help quite a bit
Also GamePanel.instance...
yeah i know its bad practise
it helped but its still not perfect 😩
since its a 32x32 tile is it better to just write a function to round numbers up to the closest multiple of 32?
then you won't have smooth scrolling
you're doing everything using floating point numbers
of course you will have rounding issues
also I don't get why you're modifying your x and y
Just have a draw function that holds the grid coordinates and make the draw function convert them to screen coordinates
This function has too many levels of abstraction
Compute the coordinates of only one tile using the formula you want. All other tile positions, compute them by number of times a tile's width and length
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.