Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

widget.newButton doesn't work on device
Started by jason_bullen Dec 16 2018 06:10 PM

1 reply to this topic
widget newbutton

Best Answer XeduR @Spyric , 17 December 2018 - 01:12 AM

It's most likely an issue with case sensitive file names and you've input the wrong filename. A simulator wont crash if you write the filename as "buttonRedOVer.png" if the file's actual name was "buttonRedOver.png", but a device will.

So, make sure that you've written the filenames in your code exactly as they are in your project folder.

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jason_bullen

[GLOBAL: userInfoPane.html]
jason_bullen
  • Observer

  • 8 posts
  • Corona SDK

My game works fine in the simulator but shows an error on my phone.

The problem is with the button files not loading.

Here is my code:

 

    button1 = widget.newButton(
    {
        x=270,
        y=0,
        width = 200,
        height = 90,
        defaultFile = "buttons/buttonRed.png",
        overFile = "buttons/buttonRedOVer.png",
        label = "MSG",
        fontSize = 60,
        emboss = true,
        labelColor = { default={ 1, 1, 1 }, over={ 1, 1, 1, 0.5 } },
    });
    button1:addEventListener( "tap", onButtonShowPlayersTap )

    _group:insert( button1 );

 

this is the warning:

12:07:14.957  WARNING: case of filename 'C:\Multitouch\buttons/buttonRedOVer.png' differs on disk

 

How can I load the images?



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 884 posts
  • Corona SDK

  Best Answer

It's most likely an issue with case sensitive file names and you've input the wrong filename. A simulator wont crash if you write the filename as "buttonRedOVer.png" if the file's actual name was "buttonRedOver.png", but a device will.

So, make sure that you've written the filenames in your code exactly as they are in your project folder.




[topic_controls]
[/topic_controls]