本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setScaling()
方法的一些代码示例,展示了Image.setScaling()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setScaling()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Image
类名称:Image
方法名:setScaling
暂无
代码示例来源:origin: libgdx/libgdx
public ImageButton (ImageButtonStyle style) {
super(style);
image = new Image();
image.setScaling(Scaling.fit);
add(image);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
}
代码示例来源:origin: libgdx/libgdx
public ImageButton (ImageButtonStyle style) {
super(style);
image = new Image();
image.setScaling(Scaling.fit);
add(image);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
}
代码示例来源:origin: libgdx/libgdx
public void create () {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
texture = new Texture("data/group-debug.png");
Image image = new Image(texture);
image.setScaling(Scaling.fit);
image.setBounds(100, 100, 400, 200);
stage.addActor(image);
Image image2 = new Image(texture);
image2.setScaling(Scaling.fit);
image.setBounds(100, 100, 400, 200);
image2.setOrigin(200, 100);
image2.setScale(0.5f);
stage.addActor(image2);
}
代码示例来源:origin: libgdx/libgdx
private void fillGroup (Group group, Texture texture) {
float advance = 32 + SPACING;
for (int y = 0; y < NUM_SPRITES * advance; y += advance)
for (int x = 0; x < NUM_SPRITES * advance; x += advance) {
Image img = new Image(new TextureRegion(texture));
img.setAlign(Align.center);
img.setScaling(Scaling.none);
img.setBounds(x, y, 32, 32);
img.setOrigin(16, 16);
group.addActor(img);
sprites.add(img);
}
}
代码示例来源:origin: libgdx/libgdx
public ImageTextButton (String text, ImageTextButtonStyle style) {
super(style);
this.style = style;
defaults().space(3);
image = new Image();
image.setScaling(Scaling.fit);
label = new Label(text, new LabelStyle(style.font, style.fontColor));
label.setAlignment(Align.center);
add(image);
add(label);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
}
代码示例来源:origin: libgdx/libgdx
public ImageTextButton (String text, ImageTextButtonStyle style) {
super(style);
this.style = style;
defaults().space(3);
image = new Image();
image.setScaling(Scaling.fit);
label = new Label(text, new LabelStyle(style.font, style.fontColor));
label.setAlignment(Align.center);
add(image);
add(label);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
}
代码示例来源:origin: libgdx/libgdx
@Override
public void create () {
skin = new Skin(Gdx.files.internal("data/uiskin.json"));
image2 = new TextureRegion(new Texture(Gdx.files.internal("data/badlogic.jpg")));
ui = new Stage();
Gdx.input.setInputProcessor(ui);
root = new Table();
root.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
ui.addActor(root);
root.debug();
Image image = new Image(image2);
image.setScaling(Scaling.fill);
root.add(image).width(image2.getRegionWidth()).height(image2.getRegionHeight());
}
代码示例来源:origin: libgdx/libgdx
blend.setScaling(Scaling.none);
blend.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
rotate.setScaling(Scaling.none);
rotate.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
scale.setScaling(Scaling.none);
scale.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
代码示例来源:origin: crashinvaders/gdx-texture-packer-gui
public SourceImage(Pixmap pixmap) {
this.pixmap = pixmap;
image = new Image();
image.setScaling(Scaling.stretch);
addActor(image);
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
public ImageButton (ImageButtonStyle style) {
super(style);
image = new Image();
image.setScaling(Scaling.fit);
add(image);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
}
代码示例来源:origin: kotcrab/vis-ui
private void init () {
image = new Image();
image.setScaling(Scaling.fit);
add(image);
setSize(getPrefWidth(), getPrefHeight());
addListener(new InputListener() {
@Override
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
if (isDisabled() == false) FocusManager.switchFocus(getStage(), VisImageButton.this);
return false;
}
});
updateImage();
}
代码示例来源:origin: kotcrab/vis-ui
sortByDescendingImage = sortByDescending.getImage();
sortByNameImage.setScaling(Scaling.none);
sortByDateImage.setScaling(Scaling.none);
sortBySizeImage.setScaling(Scaling.none);
sortByAscendingImage.setScaling(Scaling.none);
sortByDescendingImage.setScaling(Scaling.none);
代码示例来源:origin: crashinvaders/gdx-texture-packer-gui
public ExpandEditTextButton(String text, Style style) {
super(style);
this.style = style;
label = new VisLabel(text, style.labelStyle);
label.setAlignment(Align.left);
label.setEllipsis(true);
labelCell = add(label).growX().left().width(new LabelCellWidthValue());
if (style.expandIcon != null) {
Image image = new Image(style.expandIcon);
image.setScaling(Scaling.none);
expandIconCell = add(image).padLeft(4f);
}
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
public ImageTextButton (String text, ImageTextButtonStyle style) {
super(style);
this.style = style;
defaults().space(3);
image = new Image();
image.setScaling(Scaling.fit);
label = new Label(text, new LabelStyle(style.font, style.fontColor));
label.setAlignment(Align.center);
add(image);
add(label);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
}
代码示例来源:origin: kotcrab/vis-ui
private void init (String text) {
defaults().space(3);
image = new Image();
image.setScaling(Scaling.fit);
add(image);
label = new Label(text, new LabelStyle(style.font, style.fontColor));
label.setAlignment(Align.center);
add(label);
setStyle(style);
setSize(getPrefWidth(), getPrefHeight());
addListener(new InputListener() {
@Override
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
if (isDisabled() == false) FocusManager.switchFocus(getStage(), VisImageTextButton.this);
return false;
}
});
}
代码示例来源:origin: kotcrab/vis-ui
public TabButtonTable (Tab tab) {
this.tab = tab;
button = new VisTextButton(getTabTitle(tab), style.buttonStyle) {
@Override
public void setDisabled (boolean isDisabled) {
super.setDisabled(isDisabled);
closeButton.setDisabled(isDisabled);
deselect();
}
};
button.setFocusBorderEnabled(false);
button.setProgrammaticChangeEvents(false);
closeButtonStyle = new VisImageButtonStyle(VisUI.getSkin().get("close", VisImageButtonStyle.class));
closeButton = new VisImageButton(closeButtonStyle);
closeButton.setGenerateDisabledImage(true);
closeButton.getImage().setScaling(Scaling.fill);
closeButton.getImage().setColor(Color.RED);
addListeners();
buttonStyle = new VisTextButtonStyle((VisTextButtonStyle) button.getStyle());
button.setStyle(buttonStyle);
closeButtonStyle = closeButton.getStyle();
up = buttonStyle.up;
add(button);
if (tab.isCloseableByUser()) {
add(closeButton).size(14 * sizes.scaleFactor, button.getHeight());
}
}
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
bgImage.setScaling(Scaling.fit);
infoContainer = new Container<Image>(bgImage);
setInfo(INFO);
代码示例来源:origin: langurmonkey/gaiasky
image.setScaling(Scaling.fit);
add(image).size(22);
代码示例来源:origin: kotcrab/vis-ui
if (image != null) image.setScaling(Scaling.fit);
add(image).size(sizes.menuItemIconSize);
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
north = new HorizontalGroup();
collapseImg = new Image();
collapseImg.setScaling(Scaling.none);
内容来源于网络,如有侵权,请联系作者删除!