Why use UI When there is a much simpler way.

Hi,

Why use UI ??? There is a lot easier way of having buttons with the code below. No more need to have the Ui library, no more need a writing all the code for the UI button. It is faster, it is a better button function.

PLEASE CAN SOME ONE TELL ME WHY WE USE UI?

New UI button?

[code]

– EXAMPLE
– No more need of UI, with this code…

local yourOBject = display.newImage “yourObject.png”

function yourFunction ()

physics.pause()

end

youObject:addEventListener(“tap”, yourFunction) [import]uid: 23689 topic_id: 14511 reply_id: 314511[/import]

i am using that for 1 reason it allows me to show hover image when i touch it and resets previous image when i lift that button

:slight_smile:

[import]uid: 12482 topic_id: 14511 reply_id: 53725[/import]

Michael,

you need the brackets in line 4 ‘(’ and ‘)’
you need to make the B small in line 4
you need a ‘r’ in line 12

and if you are trying to use physics.pause() you need to require physics, otherwise you cannot have physics.pause it will spawn an error.

I understand that you are putting some code together to demonstrate a point.

now for your question,

Who says that everyone uses the UI class? Majority of the developers write their own and many use stuff like what you posted.

It is beginners that ask for a *true* button that will look and feel like a button.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 14511 reply_id: 53738[/import]

Ok thanks. I wasn’t really paying attention, thanks for the whole paragraph of what i did wrong :wink: I was just confused of the UI dilema because it took me along time to learn how to use it. [import]uid: 23689 topic_id: 14511 reply_id: 53788[/import]