当前位置: 首页>>代码示例>>Java>>正文


Java TiledDrawable类代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable的典型用法代码示例。如果您正苦于以下问题:Java TiledDrawable类的具体用法?Java TiledDrawable怎么用?Java TiledDrawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TiledDrawable类属于com.badlogic.gdx.scenes.scene2d.utils包,在下文中一共展示了TiledDrawable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ScrollerPane

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public ScrollerPane(TiledDrawable tiledDrawable, float xSpeed, float ySpeed) {
    this.tiledDrawable = tiledDrawable;
    this.xSpeed = xSpeed;
    this.ySpeed = ySpeed;
    xPosition = 0.0f;
    yPosition = 0.0f;
    
    Image image = new Image(tiledDrawable);
    
    innerTable = new Table();
    innerTable.add(image).width(5000);
    scrollPane = new ScrollPane(innerTable);
    scrollPane.setTouchable(Touchable.disabled);
    scrollPane.setSmoothScrolling(false);
    this.add(scrollPane).grow();
}
 
开发者ID:raeleus,项目名称:bobbybird,代码行数:17,代码来源:ScrollerPane.java

示例2: MenuScreen

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public MenuScreen(MainGameClass game) {
    this.game = game;

    stage = new Stage(new ScreenViewport());
    Gdx.input.setInputProcessor(stage);

    skin = new Skin(Gdx.files.internal("skins/Flat_Earth_UI_Skin/flatearthui/flat-earth-ui.json"));

    progressBarStyle = skin.get("fancy", ProgressBar.ProgressBarStyle.class);
    TiledDrawable tiledDrawable = skin.getTiledDrawable("slider-fancy-knob").tint(skin.getColor("selection"));
    tiledDrawable.setMinWidth(0);
    progressBarStyle.knobBefore = tiledDrawable;

    sliderStyle = skin.get("fancy", Slider.SliderStyle.class);
    sliderStyle.knobBefore = tiledDrawable;

    layoutTable = new Table();
    layoutTable.top();
    layoutTable.setFillParent(true);
    layoutTable.pad(getPixelSizeFromDensityIndependentPixels(50));
}
 
开发者ID:johannesmols,项目名称:GangsterSquirrel,代码行数:22,代码来源:MenuScreen.java

示例3: getScrollPaneStyle

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private static ScrollPane.ScrollPaneStyle getScrollPaneStyle()
{
    ScrollPane.ScrollPaneStyle scrollPaneStyle = new ScrollPane.ScrollPaneStyle();

    TiledDrawable scrollKnob = getTiledDrawable(Color.WHITE);
    TiledDrawable scrollBackground = getTiledDrawable(Color.DARK_GRAY);

    float size = Constants.Visual.UI.SQRT_PIXELS * 0.01f;
    scrollKnob.setMinWidth(size);
    scrollBackground.setMinWidth(size);
    scrollKnob.setMinHeight(size);
    scrollBackground.setMinHeight(size);

    scrollPaneStyle.hScrollKnob = scrollKnob;
    scrollPaneStyle.vScrollKnob = scrollKnob;
    scrollPaneStyle.hScroll = scrollBackground;
    scrollPaneStyle.vScroll = scrollBackground;

    return scrollPaneStyle;
}
 
开发者ID:overengineering,项目名称:space-travels-3,代码行数:21,代码来源:UIManager.java

示例4: setupUI

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private void setupUI()
{
	Skin skin = assetMgr.get("ui/ui.skin", Skin.class);
	TextureAtlas uiAtlas = assetMgr.get("ui/ui.atlas", TextureAtlas.class);
	
	title = new TiledDrawable( uiAtlas.findRegion("title") );
	stars = new TiledDrawable( uiAtlas.findRegion("space_background") );
	
	Table mainTable = new Table();
	mainTable.setFillParent(true);

	mainTable.row().expand().padTop(350f).padLeft(150f).padRight(150f);
	createProgressBar(skin, mainTable);

	stage.addActor(mainTable);
}
 
开发者ID:saltares,项目名称:libgdxjam,代码行数:17,代码来源:LoadingScreen.java

示例5: setupUI

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private void setupUI()
{
	Skin skin = assetMgr.get(Env.UI_FOLDER + "/ui.skin", Skin.class);
	TextureAtlas uiAtlas = assetMgr.get(Env.UI_FOLDER + "/ui.atlas", TextureAtlas.class);
	
	title = new TiledDrawable( uiAtlas.findRegion("title") );
	stars = new TiledDrawable( uiAtlas.findRegion("space_background") );
	
	Table mainTable = new Table();
	mainTable.setFillParent(true);

	mainTable.row().expand().padTop(350f);
	createButtons(skin, mainTable);

	stage.addActor(mainTable);
}
 
开发者ID:saltares,项目名称:libgdxjam,代码行数:17,代码来源:MainMenuScreen.java

示例6: Background

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public Background(AssetManager manager) {
    manager.setLoader(Texture.class, new TextureLoader(new InternalFileHandleResolver()));
    manager.load(TEXTURE_FILENAME, Texture.class);
    manager.finishLoading();

    texture = manager.get(TEXTURE_FILENAME);
    
    TextureRegion[] frames = TextureRegion.split(texture, FRAME_WIDTH, FRAME_HEIGHT)[0];
    animation = new Animation(0.1f, frames[0], frames[1], frames[2]);
    animation.setPlayMode(PlayMode.LOOP);
    
    setWidth(FRAME_WIDTH);
    setHeight(FRAME_HEIGHT);
    
    background = new TiledDrawable(animation.getKeyFrame(0f));
}
 
开发者ID:broken-shotgun,项目名称:throw-the-moon,代码行数:17,代码来源:Background.java

示例7: WindowTable

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public WindowTable(final MessageStyle style) {

		stack(new Table() {
			{
				if (style.bg != null) {
					add(new Table() {
						{
							setBackground(new TiledDrawable(Drawables.skin(style.bg)));
						}
					}).expand().fill().pad(3);
				}
			}
		}, new Table() {
			{
				if (style.frame != null) {
					setBackground(Drawables.ninePatch(style.frame));
				}
				add(content = new Table()).expand().fill();
			}
		}).expand().fill();

	}
 
开发者ID:adketuri,项目名称:umbracraft,代码行数:23,代码来源:WindowTable.java

示例8: setupPlanets

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private void setupPlanets() {

		planetSprites[0] = new Sprite(App.TEXTURES.findRegion("planet01"));
		planetSprites[1] = new Sprite(App.TEXTURES.findRegion("planet02"));
		planetSprites[2] = new Sprite(App.TEXTURES.findRegion("planet03"));
		planetSprites[3] = new Sprite(App.TEXTURES.findRegion("planet04"));
		planetSprites[4] = new Sprite(App.TEXTURES.findRegion("planet05"));
		planetSprites[5] = new Sprite(App.TEXTURES.findRegion("planet06"));
		planetSprites[6] = new Sprite(App.TEXTURES.findRegion("planet07"));
		planetSprites[7] = new Sprite(App.TEXTURES.findRegion("planet08"));
		planetSprites[8] = new Sprite(App.TEXTURES.findRegion("planet09"));
		planetSprites[9] = new Sprite(App.TEXTURES.findRegion("planet10"));

		sunSprite = new Sprite(App.TEXTURES.findRegion("sun"));
		sunSprite.setPosition(-sunSprite.getWidth() / 2, -sunSprite.getHeight() / 2);

		//pointLight = new PointLight[SolarSystem.NUMBER_OF_PLANETS];
		for (int i = 0; i < SolarSystem.NUMBER_OF_PLANETS; i++) {
			Vector2 position = App.solarSystem.getPlanetPosition(i);
			planetSprites[i].setPosition(position.x, position.y);
		}
		TextureAtlas.AtlasRegion stars = App.TEXTURES.findRegion("stars");
		bgTile = new TiledDrawable(stars);
	}
 
开发者ID:aphex-,项目名称:Alien-Ark,代码行数:25,代码来源:SolarScreen.java

示例9: loadTiledDrawables

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private void loadTiledDrawables() {
	if(patches[TOP_CENTER] != null) {
		topCenter = new TiledDrawable(patches[TOP_CENTER]);
	}
	if(patches[MIDDLE_LEFT] != null) {
		middleLeft = new TiledDrawable(patches[MIDDLE_LEFT]);
	}
	if(patches[MIDDLE_CENTER] != null) {
		middleCenter = new TiledDrawable(patches[MIDDLE_CENTER]);
	}
	if(patches[MIDDLE_RIGHT] != null) {
		middleRight = new TiledDrawable(patches[MIDDLE_RIGHT]);
	}
	if(patches[BOTTOM_CENTER] != null) {
		bottomCenter = new TiledDrawable(patches[BOTTOM_CENTER]);
	}
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:18,代码来源:RepeatedNinePatch.java

示例10: getTiledDrawable

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public TiledDrawable getTiledDrawable(String paramString)
{
  TiledDrawable localTiledDrawable1 = (TiledDrawable)optional(paramString, TiledDrawable.class);
  if (localTiledDrawable1 != null);
  Drawable localDrawable;
  do
  {
    return localTiledDrawable1;
    localDrawable = (Drawable)optional(paramString, Drawable.class);
    if (localTiledDrawable1 == null)
      break;
  }
  while ((localDrawable instanceof TiledDrawable));
  throw new GdxRuntimeException("Drawable found but is not a TiledDrawable: " + paramString + ", " + localDrawable.getClass().getName());
  TiledDrawable localTiledDrawable2 = new TiledDrawable(getRegion(paramString));
  add(paramString, localTiledDrawable2, TiledDrawable.class);
  return localTiledDrawable2;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:19,代码来源:Skin.java

示例11: setBackdrop

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public void setBackdrop(String textureFile) {
	if (backdropTextureFile != null) {
		assets.unload(backdropTextureFile);
	}
	backdropTextureFile = textureFile;
	assets.load(textureFile, Texture.class);
	assets.finishLoadingAsset(textureFile);
	Texture texture = assets.get(textureFile, Texture.class);
	TiledDrawable tiled = new TiledDrawable(new TextureRegion(texture));
	Image img = new Image(tiled);
	img.setFillParent(true);
	backStage.addActor(img);
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:14,代码来源:AbstractScreen.java

示例12: getDelimitedTiledDrawableChunk

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private static TiledDrawable getDelimitedTiledDrawableChunk(
    int delimiterWidth,
    int width,
    int height, Color backgroundColor,
    Color delimiterColor)
{
    Pixmap pixmap = new Pixmap(
        width,
        height,
        Pixmap.Format.RGBA8888);

    pixmap.setColor(backgroundColor);
    pixmap.fillRectangle(0, 0, pixmap.getWidth() - delimiterWidth, pixmap.getHeight());

    pixmap.setColor(delimiterColor);
    pixmap.fillRectangle(
        pixmap.getWidth() - delimiterWidth,
        0,
        delimiterWidth,
        pixmap.getHeight());

    Texture texture = new Texture(pixmap);
    pixmap.dispose();

    TextureRegion textureRegion = new TextureRegion(texture);

    TiledDrawable tiledDrawable = new TiledDrawable(textureRegion);

    return tiledDrawable;
}
 
开发者ID:overengineering,项目名称:space-travels-3,代码行数:31,代码来源:UIManager.java

示例13: ControlsWindow

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public ControlsWindow(String title, Skin skin, Stage ui) {
    super(title, skin);
    this.setName(title);
    this.skin = skin;
    this.ui = ui;

    /** Global resources **/
    TextureRegion septexreg = ((TextureRegionDrawable) skin.newDrawable("separator")).getRegion();
    septexreg.getTexture().setWrap(TextureWrap.Repeat, TextureWrap.ClampToEdge);
    this.separator = new TiledDrawable(septexreg);

    EventManager.instance.subscribe(this, Events.TOGGLE_TIME_CMD, Events.GUI_SCROLL_POSITION_CMD, Events.GUI_FOLD_CMD, Events.GUI_MOVE_CMD, Events.RECALCULATE_OPTIONS_SIZE);
}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:14,代码来源:ControlsWindow.java

示例14: TilesetDrawable

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
public TilesetDrawable(TextureRegion... regions) {
	assert (drawables.length == 9);
	drawables = new Drawable[9];
	drawables[0] = new TextureRegionDrawable(regions[0]);
	if (regions[1] != null) drawables[1] = new TiledDrawable(regions[1]);
	if (regions[2] != null) drawables[2] = new TextureRegionDrawable(regions[2]);
	if (regions[3] != null) drawables[3] = new TiledDrawable(regions[3]);
	if (regions[4] != null) drawables[4] = new TiledDrawable(regions[4]);
	if (regions[5] != null) drawables[5] = new TiledDrawable(regions[5]);
	if (regions[6] != null) drawables[6] = new TextureRegionDrawable(regions[6]);
	if (regions[7] != null) drawables[7] = new TiledDrawable(regions[7]);
	if (regions[8] != null) drawables[8] = new TextureRegionDrawable(regions[8]);
}
 
开发者ID:Dakror,项目名称:Vloxlands,代码行数:14,代码来源:TilesetDrawable.java

示例15: getCloud

import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable; //导入依赖的package包/类
private TiledDrawable getCloud() {
    Array<String> names = getCore().getImagePacks().get(DATA_PATH + "/clouds");
    
    TiledDrawable tiledDrawable = new TiledDrawable(getCore().getAtlas().findRegion(names.random()));
    return tiledDrawable;
}
 
开发者ID:raeleus,项目名称:bobbybird,代码行数:7,代码来源:MenuState.java


注:本文中的com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。