Log In  
Follow
Aviyr

Hey, I'm new here, so I don't really know what to type here. I'm from Germany. I like to play Minecraft and other Retro Games.


This is for anyone that didn't manage to find a solution or was too lazy to look at the Picotron Documentation (like me).

You can get the window size after the user resized the window with
get_display():width()
and
get_display():height()
, respectively.

To detect when the window is resized, you can use the following code by arnaught:

on_event("resize", function (msg)
    width = msg.width
    height = msg.height
end)

Another solution would be to constantly compare a variable to the current screen width and height. From my experience, this is a better solution performance-wise, but you can try both options and see which fits best for your purposes.

function _update()
	if height != get_display():height() or width != get_display():width() then
		height = get_display():height()
		width = get_display():width()

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160517#p)
3
2 comments



Hello, this is my Celeste Mod which makes the game a bit easier because I'm bad and can't play the game without mods.

0 comments