Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Does APPLICATION_RESIZE event update application class? — Gideros Forum

Does APPLICATION_RESIZE event update application class?

mamicomamico Member
edited March 2016 in Code snippets
Hi all, I'm using API v2015.12 and when I run the script below on APPLICATION_RESIZE event I don't get new dimensions in application class (I saw this feature in the release description of API v2015.03.22 ). What is the problem?
View = Core.class(Sprite)
 
function View:init()
	application:setBackgroundColor(0xFF00FF)
	self:dump()
 
	self:addEventListener(Event.APPLICATION_RESIZE,function()
		print("--- RESIZE ---")
		application:setBackgroundColor(0xFFFF00)
		self:dump()
	end)
 
 
end
 
function View:dump()
	print("API Version ".. application:getApiVersion())
	print("Content Width: " .. application:getContentWidth())
	print("Content Height: " .. application:getContentHeight())
	print("Logical Width: " .. application:getLogicalWidth())
	print("Logical Height: " .. application:getLogicalHeight())
	print("Device Width: " .. application:getDeviceWidth())
	print("Device Height: " .. application:getDeviceHeight())
	print("\n\n")
end

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Hello @mamico
    please provide platform on which you are trying and example output provided
  • Ok, I'm using Gideros Player on Mac OS X with 320x480 IPhone resolution and after I changed it to 640x1163 Iphone5 this is the output (this happen with any device resolution):
    view.lua is uploading.
    Uploading finished.
    API Version 2015.12
    Content Width: 320
    Content Height: 480
    Logical Width: 320
    Logical Height: 480
    Device Width: 320
    Device Height: 480
     
     
     
    --- RESIZE ---
    API Version 2015.12
    Content Width: 320
    Content Height: 480
    Logical Width: 320
    Logical Height: 480
    Device Width: 320
    Device Height: 480
  • ar2rsawseenar2rsawseen Maintainer
    I see, as far as I remember player needs to be restarted to take into account new resolution. But I do not remember if exported app has the same behavior or not.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • Thank you for your answer I will try with exported app.
Sign In or Register to comment.