Spin wheel

susu

Well-Known Member
Licensed User
Longtime User
It's better without scroll bar :D
 

Attachments

  • withoutscrollbar.zip
    7.3 KB · Views: 425

birnesoft

Active Member
Licensed User
Longtime User
Sorry, but now it's completly destroyed: Every tick it becomes more chaotic till all the numbers are gone.
And then the title shows "50:20:20"?!?

On my Milestone2 and on the Emulator it works without problems.
You've tryed the sample40?

gruss Birne
 

Jost aus Soest

Active Member
Licensed User
Longtime User
It's better without scroll bar :D

This one looks - on my Galaxy Note - better, but not perfect:
The numbers aren't centered (half line to high), so the black lines are still going through the numbers.

BTW: If I change the orientation, the numbers are changing, too.
 

birnesoft

Active Member
Licensed User
Longtime User
Works good on the emulator 1280x800

Hy Jost,

Works good on the emulator 1280x800
did you tryed to set the lOffset variable?
______________________________

The numbers are random and change with the orientation.

only change this to resolve this:

if firsttime =true then
For ii = 0 To 5
pp(ii)=Rnd(0,12)*lh
sv(ii).ScrollPosition=(Round(pp(ii)/lh)*lh+5)*1dip
Next
end if
----------------------
set your own Values

pp(ii)=yourValue


good luck

Björn
 

birnesoft

Active Member
Licensed User
Longtime User
Normally yes, but try it and tell me if it works.

I can't make any changes when it works fine on my device and emaulators.

have anybody other the same problem?
 

Jost aus Soest

Active Member
Licensed User
Longtime User
Sorry, but no change. :(
BTW: The numbers are still disappearing after a while...

I will analyze the code by myself when I have a lit bit of freetime...

Thanks anyway!
 

derez

Expert
Licensed User
Longtime User
Real wheel

Here is my two cents for this great invention:
The wheels are cyclic, i.e. the first number appears at the end and you can reach all numbers by scrolling in one direction, either up or down (although the wheel is sometimes trying to resist the changeover).
Also - I added a map to show how other values can be used.
Last - I removed the gradientlabels and put all on the overlay.

The code runs on 480x800 - 160, didn't bother to optimize for other displays.
 

Attachments

  • wheel_bar.zip
    353.8 KB · Views: 435
  • screen.jpg
    screen.jpg
    34.5 KB · Views: 694

JoanRPM

Active Member
Licensed User
Longtime User
derez, thanks for your code. I like this because now it is a really worm wheel. It is useful when you have numbers from 0 to 9. I will study your code.
I am also working on this issue, this last days.
I'm trying to do everything with parameters: n panels of n wheels each, from a minimun number to another maximun, positive and negative...
I have little experience in B4A yet, and I have a problem.
To be more comfortable, like you, I make the panels in the designer (only need the label for each pannel, others things are make by code). Because it can be more than one panel I would like to make these labels with indexes "label (num_panels)", but I think I can not do so (from the designer).
I tried other formulas, but without much success. The idea would be to create a label with code index and copy the characteristics (height, width ...) of each label's designer.
I tried something like this, but does not work:

Activity.LoadLayout ("main")
'convert Lbl_scroll_P1, P2, P3 from Designer to Lbl_scroll_P(n_panels)
Lbl_scroll_P (0). Left = Lbl_scroll_P1.Left
Lbl_scroll_P (0). Top = Lbl_scroll_P1.Top
Lbl_scroll_P (0). Width = Lbl_scroll_P1.Width
Lbl_scroll_P (0). Height = Lbl_scroll_P1.Height

Lbl_scroll_P (1). Left = Lbl_scroll_P2.Left
Lbl_scroll_P (1). Top = Lbl_scroll_P2.Top
.....
.....

The label "Lbl_scroll_P1" is what I have in the designer and try to copy it into Lbl_scroll_P (x).
Anyone know any way to copy the properties of an object and put them in another object? (in this case a label)
As soon as I finished it I will post the code.
Here there is a sample image.
 

Attachments

  • foto.png
    foto.png
    48.5 KB · Views: 530

derez

Expert
Licensed User
Longtime User
It should work, but check if you declared the label array in sub globals, and that you initialise each of the labels before copying the properties.

dim Lbl_scroll_P (n) as label
....
for i = 0 to n-1
Lbl_scroll_P (i).initialise("")
next

And btw, the panel in my code is not by the designer but in code, and everything is attached to the panel so I need to define only the place of this panel in every application that use it.
 

birnesoft

Active Member
Licensed User
Longtime User
Great work derez

:sign0098:

I've added the code from susu (without scroll bars)
and with the Timer on 1500 is more smooth

Birne
 

Attachments

  • wheel_bar6_0.zip
    10.9 KB · Views: 483

JoanRPM

Active Member
Licensed User
Longtime User
Hi all.
Here is my latest version of the famous wheel.
Surely will be surmountable, or there will be some bugs or not be compatible with all devices ... I have little experience.
Sorry Derez, I can not add your code to be a endless wheel. I have not had time.

The idea is that if you need more than one panel, it is very easy to implement.
You only need to create the panels in the Designer (also could from the code), define a borner color (in the Designer) and in the code define:
- How many wheels are in each panel.
- The minimum and maximum values ​​of each wheel.
- Some additional values​​: the maximum number of wheels that are in a panel, the total number of panels.
And that's all.

To more easily, I have a comment ("Wheel Define") by which you can modify the properties.

Could be improved still more:
- Be able to select which panels you want to be an endless wheel.
- The ability to select for each panel: the wheel colors,the color text, ...

Greetings.
 

Attachments

  • Foto.png
    Foto.png
    58.7 KB · Views: 667
  • wheel_jr5.zip
    8.2 KB · Views: 530

Louis Ashford

New Member
Licensed User
Longtime User
Missing something

Hi,
I just tried to run your wheel demo and it will not build. Seems there is something missing. The dimension statement

Dim loc As AHLocale <- does not know what AHLocal is.

is there a file I am missing?

Thanks
Louis
 

BarrySumpter

Active Member
Licensed User
Longtime User
Hi everyone!
This is some really nice work.
Thanks to all who contributed.

Next is graphics like playing the pokies!

;)
 

luke2012

Well-Known Member
Licensed User
Longtime User
Hi all.
Here is my latest version of the famous wheel.
Surely will be surmountable, or there will be some bugs or not be compatible with all devices ... I have little experience.
Sorry Derez, I can not add your code to be a endless wheel. I have not had time.

The idea is that if you need more than one panel, it is very easy to implement.
You only need to create the panels in the Designer (also could from the code), define a borner color (in the Designer) and in the code define:
- How many wheels are in each panel.
- The minimum and maximum values of each wheel.
- Some additional values: the maximum number of wheels that are in a panel, the total number of panels.
And that's all.

To more easily, I have a comment ("Wheel Define") by which you can modify the properties.

Could be improved still more:
- Be able to select which panels you want to be an endless wheel.
- The ability to select for each panel: the wheel colors,the color text, ...

Greetings.

Hi JoanRPM! :)
It's possible to show the wheelfor number selection in horizontal mode?
 
Top