Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
lazior
Posts: 18
Registered: ‎01-18-2013
My Device: Z10 10.2
My Carrier: Chunghwa Telecom

how to make a wheel, slot machine

Hello all,

 

if I want to use qml to make a slot machine.

 

How to make a wheel like this:

http://sunilsuthar02.blogspot.tw/2012/10/wheel-view-demo-in-android.html

 

use a custom picker?

Or a listview?

 

if use listview, how to let it roll Automatically?

 

Thanks for your kindly reply!

 

Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: how to make a wheel, slot machine

Why not just use a very simple animation, take a look at the cookbook example (the one with the egg) for an idea of how it works.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
zeusk
Posts: 33
Registered: ‎01-08-2013
My Device: Z10 LE
My Carrier: Vodafone

Re: how to make a wheel, slot machine

You should look at the sample apps :smileywink:

Please use plain text.
Developer
sunnyone
Posts: 108
Registered: ‎04-14-2013
My Device: BlackBerry Z30
My Carrier: Chunghwa Telecom

Re: how to make a wheel, slot machine

For the simply thing I may use an webview with html to make it works...
BlackBerry Certified Cascades Developer
Please use plain text.
Developer
lazior
Posts: 18
Registered: ‎01-18-2013
My Device: Z10 10.2
My Carrier: Chunghwa Telecom

Re: how to make a wheel, slot machine

[ Edited ]

I want to create a list and let its item roll

Ex: I have a list contains

A

B

C

D

 

I want the whell can show like 

A     B     C

B > C  > D >

C    D     A

 

And I can update the list.

Can this be made by animation?

Please use plain text.
Developer
greenback
Posts: 527
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

Re: how to make a wheel, slot machine

This is not possible to achieve. You may have to use OpenGL or some custom c++ to achieve the effect. Good luck!

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: how to make a wheel, slot machine

This should be achievable using AbsoluteLayout and Images by changing coordinates of images either manually or using animations.

Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
lazior
Posts: 18
Registered: ‎01-18-2013
My Device: Z10 10.2
My Carrier: Chunghwa Telecom

Re: how to make a wheel, slot machine

what I do now is

first define five image view

and use stack layout and its height is 3Y

 

imageView 1 is invisible

2,3,4 and 5 is visible

image view 1 load item1 and image view load item 2 , etc..

image view 1's y position is -Y

image view 2's y position is 0

image view 3's y position is Y

4's is 2Y

5's is 3Y

 

then use transition Y move all image views up Y/2 and judge if the y position reach -Y or -2Y

if reach -2Y -> move to 3Y, visible = true and load next item in the list

if reach -Y -> visible = false

 

but in this way I must check each image view's y position in every microsecond.

and will do a lot of "if" statement, which will make the device become hotter.

It seems is not a good slouction.

Please use plain text.