• 2D
  • Programming absolute values and different resolutions

Hey,

Have simple question, but couldn't find answer.

Let's say I have some simple 2d scene, with set project resolution of 1080p. Can I program some absolute values in gdscript (for example: "if input = sth: some_node.position.y + 100) - for changing object positions without risk of it being completely out of scale in different resolution (with mode = 2d and aspect = keep)? I mean, if player will change resolution to something different than 1080p (my proejct default resolution) - will my values (100) from script recalculate to new resolution to keep proportion, or should I avoid absolute values in scripts, only referencing current height/width?

Er so thats what I get for making a comment in a hurry... No when using something like kinematic bodies move_and_slide you shouldn't need to take the window size into account. For some reason I was assuming that you were building your own completely custom node translation function for some reason. Which probably makes very little sense.