Author Topic: Adding Radio Button  (Read 4195 times)

yourfriendswathi

  • Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Adding Radio Button
« on: Sun, Mar 17, 2013 »
Can someone tell me how to add ButtonGroup to BomberPlanet code in flixel-gdx-examples project
« Last Edit: Tue, Mar 26, 2013 by yourfriendswathi »

war_fire

  • Guest
Re: Adding ButtonGroup
« Reply #1 on: Mon, Mar 18, 2013 »
Don't know what you mean by anyhting there, except the arrow key movment for the camera. The easiest way would be to
Code: [Select]
if(FlxG.keys.UP)
{
FlxG.camera.scroll.y -= 5;
}
//And also for every other direction
Or you could have a FlxSprite in the middle of the screen, make it's alpha 0, and controll ots velocity woth arrow keys. Then use FlxG.camera.follow(nameOfSprite);
Hope that helps, even if it isn't what you meant.

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: Adding ButtonGroup
« Reply #2 on: Mon, Mar 18, 2013 »
Are you refering ButtonGroup component from Swing? If so, that won't work. Just use FlxButton.
For the keyboard movement, you can check the FlxCollision PlayState2.

yourfriendswathi

  • Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Adding Radio Button
« Reply #3 on: Mon, Mar 25, 2013 »
Don't know what you mean by anyhting there, except the arrow key movment for the camera. The easiest way would be to
Code: [Select]
if(FlxG.keys.UP)
{
FlxG.camera.scroll.y -= 5;
}
//And also for every other direction
Or you could have a FlxSprite in the middle of the screen, make it's alpha 0, and controll ots velocity woth arrow keys. Then use FlxG.camera.follow(nameOfSprite);
Hope that helps, even if it isn't what you meant.

Thank you. Screen movement code worked. Can you tell me how to add RadioButton functionality?
« Last Edit: Tue, Mar 26, 2013 by yourfriendswathi »

yourfriendswathi

  • Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Adding Radio Button
« Reply #4 on: Mon, Mar 25, 2013 »
Are you refering ButtonGroup component from Swing? If so, that won't work. Just use FlxButton.
For the keyboard movement, you can check the FlxCollision PlayState2.

I am not using ButtonGroup component from swing. Using FlxButton i am able to add normal button. But i want to add RadioButton functionality(to display different options like 1.java 2. Android 3. Html   to select one among them) instead of normal Button.
« Last Edit: Tue, Mar 26, 2013 by yourfriendswathi »

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: Adding ButtonGroup
« Reply #5 on: Tue, Mar 26, 2013 »
I am not using ButtonGroup component from swing. Using FlxButton i am able to add normal button. But i want to add RadioButton functionality(to display different options like 1.java 2. Android 3. Html   to select one among them) instead of normal Button.

Why don't you just say "I want to create a radio button" instead of ButtonGroup. No one knows what a ButtonGroup is and you write it in camel case.

The create a radio button:
1. create some buttons and turn on CheckBox style.
2. when click on a button, loop through the buttons and turn the unclicked buttons in NORMAL state.

yourfriendswathi

  • Member
  • **
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Adding ButtonGroup
« Reply #6 on: Wed, Apr 3, 2013 »
Are you refering ButtonGroup component from Swing? If so, that won't work. Just use FlxButton.
For the keyboard movement, you can check the FlxCollision PlayState2.

How can i run flixel-examples project on browser. i am able to run on both desktop and android but not in browser.
I created  the code  flixel-examples-html using libgdx setup
« Last Edit: Wed, Apr 3, 2013 by yourfriendswathi »