本文整理匯總了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));
}