本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.Actor.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Actor.setPosition方法的具体用法?Java Actor.setPosition怎么用?Java Actor.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.Actor
的用法示例。
在下文中一共展示了Actor.setPosition方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseGenAttr
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
private static void parseGenAttr(Actor actor, XmlReader.Element element){
actor.setWidth(element.getFloat("width",100));
actor.setHeight(element.getFloat("height",100));
actor.setPosition(element.getFloat("x",0),element.getFloat("y",0));
actor.setOrigin(element.getFloat("originX",0),element.getFloat("originY",0));
if (element.getAttributes().containsKey("name")){
actor.setName(element.get("name"));
}
}
示例2: parseGenAttr
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void parseGenAttr(Actor actor, XmlReader.Element element){
actor.setWidth(element.getFloat("width",100));
actor.setHeight(element.getFloat("height",100));
actor.setPosition(element.getFloat("x",0),element.getFloat("y",0));
actor.setOrigin(element.getFloat("originX",0),element.getFloat("originY",0));
if (element.getAttributes().containsKey("name")){
actor.setName(element.get("name"));
}
}
示例3: arrangeX
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void arrangeX(float y, boolean centerY, Actor... actors) {
float w = GUI_WIDTH / actors.length;
for (int i = 0; i < actors.length; i++) {
Actor a = actors[i];
a.setPosition(((i + 0.5f) * w) - (a.getWidth() / 2f), y - (centerY ? (a.getWidth() / 2f) : 0));
}
}
示例4: arrangeY
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void arrangeY(float x, boolean centerX, Actor... actors) {
float w = (GUI_HEIGHT / (actors.length + 1));
for (int i = 0; i < actors.length; i++) {
Actor a = actors[i];
a.setPosition(x - (centerX ? (a.getWidth() / 2f) : 0), ((i + 0.5f) * w) - (a.getHeight() / 2f));
}
}
示例5: arrangeX
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void arrangeX(float y, boolean centerY, Actor... actors) {
float w = GUI_WIDTH / actors.length;
for (int i = 0; i < actors.length; i++) {
Actor a = actors[i];
a.setPosition(((i + 0.5f) * w) - (a.getWidth() / 2f), y - (centerY ? (a.getWidth() / 2f) : 0));
}
}
示例6: arrangeY
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void arrangeY(float x, boolean centerX, Actor... actors) {
float w = (GUI_HEIGHT / (actors.length + 1));
for (int i = 0; i < actors.length; i++) {
Actor a = actors[i];
a.setPosition(x - (centerX ? (a.getWidth() / 2f) : 0), ((i + 0.5f) * w) - (a.getHeight() / 2f));
}
}
示例7: setPos
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void setPos(float x, float y, Actor... actors) {
for (Actor o : actors) {
o.setPosition(x, y);
}
}
示例8: center
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void center(Actor actor) {
actor.setPosition((GUI_WIDTH / 2) - (actor.getWidth() / 2), (GUI_HEIGHT / 2) - (actor.getHeight() / 2));
}
示例9: setPos
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void setPos(float x, float y, Actor... actors) {
for (Actor o : actors) {
o.setPosition(x, y);
}
}
示例10: center
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
public static void center(Actor actor) {
actor.setPosition((GUI_WIDTH / 2) - (actor.getWidth() / 2), (GUI_HEIGHT / 2) - (actor.getHeight() / 2));
}