Two widget buttons with the same size are shown in different scales on simulator and device

I have the default and over files of the Twitter and Facebook buttons. They both are 36 x 36 by default, then 64x64 for [@2x] = 1.5.

The issue is the following: when opened on simulator or device, the facebook button scales, but the twitter button does not.

What am I missing here?

Well 36x36 doubled isn’t 64x64, but 72x72.  I don’t think that’s your problem.  Can you post some code?  What does your config.lua look like?

Rob

It’s 64 x 64 because I scaled the buttons by 1.77 when exporting them.

This is my config.lua

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { graphicsCompatibility = 1, width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }

To call the buttons I use

facebook\_button = widget.newButton{ defaultFile = "images/facebook\_menu.png", overFile = "images/facebook\_menu-over.png", width, height = 36, 36, onRelease = socialFunction }

The same for Twitter.

If the buttons are the same, there shouldn’t be a behavior difference.  I would suggest that you make a temporary project that is just the button graphics and the widget.newButton calls.  Perhaps there is something else in your app stomping on something.

Rob

Well 36x36 doubled isn’t 64x64, but 72x72.  I don’t think that’s your problem.  Can you post some code?  What does your config.lua look like?

Rob

It’s 64 x 64 because I scaled the buttons by 1.77 when exporting them.

This is my config.lua

local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { graphicsCompatibility = 1, width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }

To call the buttons I use

facebook\_button = widget.newButton{ defaultFile = "images/facebook\_menu.png", overFile = "images/facebook\_menu-over.png", width, height = 36, 36, onRelease = socialFunction }

The same for Twitter.

If the buttons are the same, there shouldn’t be a behavior difference.  I would suggest that you make a temporary project that is just the button graphics and the widget.newButton calls.  Perhaps there is something else in your app stomping on something.

Rob