Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

box around text button when testing in Android
Started by mark036 Oct 08 2018 12:31 PM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

mark036

[GLOBAL: userInfoPane.html]
mark036
  • Observer

  • 24 posts
  • Corona SDK

I have a button that has a white rectangle behind it when testing in Android.  I looked through the forums and found one that said the "boolean" needs to be set to "True".  There is no reference to "boolean"  in my code.  I have put 

boolean = true

in several spots.  It either returns an error or does nothing.  I have it on a reset button.

local function resetGame()
    for i = 1, #spots do
        spots[i].moveText.text = " "
        spots[i].moveType = nil
    end
    display.remove( winningLine )
    winningLine = nil
    display.remove( winningText )
    winningText = nil
    display.remove( winningText2 )
    winningText2 = nil
        display.remove( resetButton )
    resetButton = onPress
    player = "X"
    allowMoves = true
    end

and

resetButton = widget.newButton({
        label = "Reset",
        x = display.contentCenterX +120,
        y = display.contentHeight -320,
        font = native.systemFontBold,
        fontSize = 20,
        labelColor = { default = { 1,1,1, 0.1}, over = { 1, 0, 0 } },
        onPress = resetGame
    })
    
    end

Where does it go, how do I set it, or is this even what needs to be done?



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,093 posts
  • Corona SDK

I'm not clear what you want here.  Do you want a rectangle or do you not want a rectangle.
 
A good way to write posts when you've encountered a problem is to use this format:
 
1. What you did.
2. What you expected to see.
3. What you saw.
4. Why you think it is wrong.
  • Alan PlantPot likes this

[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,093 posts
  • Corona SDK

One more note.

While I'm willing to code up examples sometimes, in cases like this I'd like to have something I can download and run.

I much prefer it when folks do the following:

1. Supply the list I mentioned above.

2. Create a TINY project that demonstrates just the issue they are having problems with.

3. Zip that project up and attach it to a post using the 'more reply options' button below.

This saves me, the person trying to help, a lot of time and by following all these steps reduces ambiguity.


There is a side benefit to doing this. Often, while spending time to make a small and clear example of the issue, you will discover the source of the issue and no longer need to post for help.
  • Alan PlantPot likes this

[TOPIC: post.html]
#4

XeduR @Spyric

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

  • 189 posts
  • Corona SDK

I think you may have misunderstood what a boolean is. Booleans are variables which can contain only two values, such as true or false.

The documentation for widget.newButton lists 3 optional options which use boolean data types, there are: isEnabled, emboss and textOnly. In other words, you may set the option "isEnabled" to true or false, i.e. does the button work or not. In your case, if you set the option "textOnly = true," then you should only see the text, if this is what you wanted... is it?


Now, even in the unlikely event that you did find what you were looking for in my answer, you (and everyone else) should really follow Ed's format, i.e. write your posts using structure.

1. What you did.
2. What you expected to see.
3. What you saw.
4. Why you think it is wrong. 

This way, it'll be easy for others to jump in and help you and no one has to make any guesses as to what the problem even is. Help others help you! :P


  • Alan PlantPot likes this


[topic_controls]
[/topic_controls]