Flixel Forums

development => releases => Topic started by: yourfriendswathi on Sun, Mar 17, 2013

Title: Adding Radio Button
Post by: yourfriendswathi on Sun, Mar 17, 2013
Can someone tell me how to add ButtonGroup to BomberPlanet code in flixel-gdx-examples project
Title: Re: Adding ButtonGroup
Post by: war_fire 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.
Title: Re: Adding ButtonGroup
Post by: Wing Eraser 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.
Title: Re: Adding Radio Button
Post by: yourfriendswathi 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?
Title: Re: Adding Radio Button
Post by: yourfriendswathi 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.
Title: Re: Adding ButtonGroup
Post by: Wing Eraser 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.
Title: Re: Adding ButtonGroup
Post by: yourfriendswathi 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