Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone game control help

Hi I am creating a game whereby two actions happen that enable a button, upon first touch of the button I need a "power" bar to scroll up and down and then on the second touch of the button the "power" bar stops scrolling and another action happens.

I have got to the stage where the button is touchable, but have no idea what you call the "power" bar control in order to search for help on how to create this.

The "power" bar is just like your traditional in game control like a sports game, where you need to set the "power" of a golf shot based on when you hit a button.

If

  1. You know the name of that type of control so I can more detailed search -or-
  2. You have some sample code that would show how this "power" bar can be achieved Then it would be gratefully appreciated
like image 795
sregorcinimod Avatar asked Nov 28 '25 03:11

sregorcinimod


1 Answers

You could use a simple progress bar (UIProgressView) but you will have to "animate" it yourself. Perhaps use a repeating timer with 20ms delay to generate small up/down changes.

More help on UIProgressView:

  • http://developer.apple.com/library/ios/#documentation/uikit/reference/UIProgressView_Class/Reference/Reference.html
  • How to initiate UIProgressView to a certain value?
like image 174
Jonas Bötel Avatar answered Nov 30 '25 17:11

Jonas Bötel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!