本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeListener.ChangeEvent方法的具体用法?Java ChangeListener.ChangeEvent怎么用?Java ChangeListener.ChangeEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.utils.ChangeListener
的用法示例。
在下文中一共展示了ChangeListener.ChangeEvent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSlider
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
public Slider addSlider(final int min, final int max, final float x, final float y) {
Slider _xblockexpression = null;
{
final Slider slider = this.addSliderWithoutLabel(min, max, x, y);
final Label label = this.addLabel((x + 150), (y + 5), ("" + Integer.valueOf(min)));
final Procedure2<ChangeListener.ChangeEvent, Actor> _function = new Procedure2<ChangeListener.ChangeEvent, Actor>() {
@Override
public void apply(final ChangeListener.ChangeEvent $0, final Actor $1) {
float _value = slider.getValue();
int _intValue = Float.valueOf(_value).intValue();
String _plus = ("" + Integer.valueOf(_intValue));
label.setText(_plus);
}
};
MyChangeListener _myChangeListener = new MyChangeListener(_function);
slider.addListener(_myChangeListener);
_xblockexpression = slider;
}
return _xblockexpression;
}
示例2: fire
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
@Override
public boolean fire(Event event) {
if (event instanceof ChangeListener.ChangeEvent) {
if (changeConditions.isSatisfied()) {
for (Invokable invokeEffect_: invokeEffects) {
invokeEffect_.invoke();
}
return super.fire(event);
} else return false;
}
else {
return super.fire(event);
}
}
示例3: changed
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
@Override
public void changed(ChangeListener.ChangeEvent event, Actor actor) {
main.getDialogFactory().showDialogColorPicker((Color) previewProperties.get("bgcolor"), new DialogColorPicker.ColorListener() {
@Override
public void selected(Color color) {
if (color != null) {
browseField.getTextButton().setText((int) (color.r * 255) + "," + (int) (color.g * 255) + "," + (int) (color.b * 255) + "," + (int) (color.a * 255));
previewProperties.put("bgcolor", color);
previewBgColor.set(color);
refreshPreview();
}
}
});
}
示例4: draw
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
@Override public void draw(Batch batch, float parentAlpha) {
effect.setPosition(getX(), getY());
Color c = getColor();
batch.setColor(c.r, c.g, c.b, c.a * parentAlpha);
effect.draw(batch, Gdx.graphics.getDeltaTime());
if (effect.isComplete()) {
ChangeListener.ChangeEvent event = Pools.obtain(ChangeListener.ChangeEvent.class);
fire(event);
Pools.free(event);
}
}
示例5: fire
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
@Override
public boolean fire(Event event) {
if (event instanceof ChangeListener.ChangeEvent) {
for (Invokable invokeEffect_ : invokeEffects) {
invokeEffect_.invoke();
}
return super.fire(event);
}
else {
return super.fire(event);
}
}
示例6: changed
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
@Override
public void changed(ChangeListener.ChangeEvent ev, Actor a) {
if (a == btnPAP) {
selectMap(false);
} else if (a == btnOnline) {
} else if (a == btnSettings) {
manager.setScreen(new SettingsScreen(manager));
} else if (a == btnAbout) {
dialogInfo.show(stage);
}
}
示例7: calculatePositionAndValue
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
void calculatePositionAndValue (float x, float y, boolean isTouchUp) {
float oldPositionX = knobPosition.x;
float oldPositionY = knobPosition.y;
float oldPercentX = knobPercent.x;
float oldPercentY = knobPercent.y;
float centerX = knobBounds.x;
float centerY = knobBounds.y;
knobPosition.set(centerX, centerY);
knobPercent.set(0f, 0f);
if (!isTouchUp) {
if (!deadzoneBounds.contains(x, y)) {
knobPercent.set((x - centerX) / knobBounds.radius, (y - centerY) / knobBounds.radius);
float length = knobPercent.len();
if (length > 1) knobPercent.scl(1 / length);
if (knobBounds.contains(x, y)) {
knobPosition.set(x, y);
} else {
knobPosition.set(knobPercent).nor().scl(knobBounds.radius).add(knobBounds.x, knobBounds.y);
}
}
}
if (oldPercentX != knobPercent.x || oldPercentY != knobPercent.y) {
ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
if (fire(changeEvent)) {
knobPercent.set(oldPercentX, oldPercentY);
knobPosition.set(oldPositionX, oldPositionY);
}
Pools.free(changeEvent);
}
}
示例8: notifyValueChanged
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
/**
* Called by {@link SpinnerModel}. Notifies when underlying model value has changed and spinner text field must updated.
* Typically there is no need to call this method manually.
* @param fireEvent if true then {@link ChangeListener.ChangeEvent} will be fired
*/
public void notifyValueChanged (boolean fireEvent) {
VisValidatableTextField textField = getTextField();
int cursor = textField.getCursorPosition();
textField.setCursorPosition(0);
textField.setText(model.getText());
textField.setCursorPosition(cursor);
if (fireEvent) {
ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
fire(changeEvent);
Pools.free(changeEvent);
}
}
示例9: changed
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
@Override
public void changed(ChangeListener.ChangeEvent ev, Actor a) {
}
示例10: fireChangeEvent
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
void fireChangeEvent() {
ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
fire(changeEvent);
Pools.free(changeEvent);
}
示例11: fireChangeEvent
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //导入方法依赖的package包/类
void fireChangeEvent () {
ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
fire(changeEvent);
Pools.free(changeEvent);
}