Custom UI

Hi… I started my first game with corona and I have a question… how can I make a custom UI?

On my game after the splash screen I have a widget where the user will be able to click left or right and a dial in the middle of the widget will turn. Where can I find information on how to do that, and what will be best way to accomplish this?

Thanks,
Ennio [import]uid: 53978 topic_id: 9199 reply_id: 309199[/import]

@enniobozetti,
Have a look at the CoronaUI, now that is a bit too big and complex project, but customUI are build in a similar fashion.

If you were using objective-C, it would be more like UIView/NSView which you have to draw, so you have to create and place all the components where you want them to be.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 9199 reply_id: 33584[/import]

@enniobozetti,
have a look at this video, maybe this is what you were talking about? This is a custom control that displays the Gauge and a Needle and is linked to a slider control.

http://iphone.oz-apps.com/a-custom-control-ui-video-demonstration

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 9199 reply_id: 33593[/import]

@jayantv

yes… something like this…

here is a link to what I’m creating… the icon in the middle that will change when you press left right.
http://cl.ly/1x100v3K3v08262F1w1R

[import]uid: 53978 topic_id: 9199 reply_id: 33597[/import]

@enniobozzetti
There was a sample from Apple that had full code which allowed the same thing that you were after, the thing about Apple is that when they remove some code, they remove all traces of the same. If I can locate that somewhere, I will let you know.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 9199 reply_id: 33670[/import]

Have you tried to create the Window with a transparent slot and place it above the icons you want to use.

Now when the button is clicked, slide the icon behind to the right using a transition and bring the next one in from the left.

Hope you get the idea. Half the time the custom controls are more about visual accomplishments than anything else.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 9199 reply_id: 33686[/import]

You could use object.rotate to rotate a png-24 with transparency :slight_smile: [import]uid: 34945 topic_id: 9199 reply_id: 33693[/import]

@jayantv
Is it possible to share the code for the custom control that displays the Gauge and a Needle and is linked to a slider control?

Thanks in advance. [import]uid: 6873 topic_id: 9199 reply_id: 34539[/import]

Hi,
I got a few requests for the Gauge Control. I have put up a few things for FREE on the forum. For this custom control, I am thinking of charging a small nominal fee of $10.00 which includes the source code for the Control as a package to be used in your own apps.

Let me work out how it works with PayPal so that you can buy it.
If you are in Australia, you can make a Bank Transfer, if you are outside, then PayPal would be easier I guess.

What are we talking about, here’s the video again here

how to use it? It’s as simple as

[lua]local gauge = require(“gauge”)

local g1 = gauge.new()

g1.position.x = 80
g1.position.y = 100

g1.setValue(50)

print(g1.getValue())[/lua] [import]uid: 3826 topic_id: 9199 reply_id: 35507[/import]

a quick update, if anyone is interested in the source code for the Custom Gauge UI, please send me an email, I will send you an invoice from PayPal and on payment, I can send you the asset files for the same. The price is AUD $10.00. send me an email on dev[at]oz-apps.com

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 9199 reply_id: 35609[/import]

Nice! Does what it’s supposed to and works out of the box! [import]uid: 11636 topic_id: 9199 reply_id: 35613[/import]