- public class Sliderche extends Actor {
- private Slider slider;
- private Table container;
- public Sliderche(){
- //Slider
- Slider.SliderStyle ss = new Slider.SliderStyle();
- ss.background = new TextureRegionDrawable(new TextureRegion(Assets.manager.get(Assets.slider, Texture.class)));
- ss.knob = new TextureRegionDrawable(new TextureRegion(Assets.manager.get(Assets.sliderKnob, Texture.class)));
- slider = new Slider(0f, 10, 1f, false, ss);
- slider.setPosition(0, 0);
- slider.addListener(new InputListener() {
- @Override
- public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
- System.out.println("slider " + slider.getValue());
- }
- @Override
- public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
- System.out.println("touch down");
- return true;
- };
- });
- container = new Table();
- container.addActor(slider);
- container.setFillParent(true);
- }
- @Override
- public void act(float delta) {
- super.act(delta);
- }
- @Override
- public void draw(Batch batch, float parentAlpha) {
- super.draw(batch, parentAlpha);
- container.draw(batch, parentAlpha);
- }
- }
SHARE
TWEET
Untitled
a guest
Oct 6th, 2015
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

