Java Code Examples for com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable

The following examples show how to use com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: gdx-vfx   Source File: ScreenBackgroundViewController.java    License: Apache License 2.0 4 votes vote down vote up
@LmlAction("createCheckerboardDrawable") Drawable createCheckerboardDrawable() {
    Texture texture = assets.get("bg-transparency-tile.png");
    return new TiledDrawable(new TextureRegion(texture));
}
 
Example 2
Source Project: gdx-texture-packer-gui   Source File: BusyBar.java    License: Apache License 2.0 4 votes vote down vote up
public BusyBar(Style style) {
    this.style = style;
    patternDrawable = new TiledDrawable((TextureRegionDrawable) style.pattern);
}
 
Example 3
@Override
public void process(final LmlParser parser, final LmlTag tag, final Image actor, final String rawAttributeData) {
    Skin skin = parser.getData().getDefaultSkin();
    TiledDrawable drawable = skin.getTiledDrawable(parser.parseString(rawAttributeData, actor));
    actor.setDrawable(drawable);
}
 
Example 4
@Override
public void process(final LmlParser parser, final LmlTag tag, final Table actor, final String rawAttributeData) {
    Skin skin = parser.getData().getDefaultSkin();
    TiledDrawable drawable = skin.getTiledDrawable(parser.parseString(rawAttributeData, actor));
    actor.setBackground(drawable);
}
 
Example 5
Source Project: bladecoder-adventure-engine   Source File: ScnWidget.java    License: Apache License 2.0 4 votes vote down vote up
public ScnWidget(Skin skin) {
	bigFont = skin.get("big-font", BitmapFont.class);
	defaultFont = skin.get("default-font", BitmapFont.class);

	setSize(150, 150);

	tile = new TiledDrawable(Ctx.assetManager.getIcon("transparent-light"));
	background = skin.getDrawable("background");

	faRenderer.setViewport(getWidth(), getHeight());

	setLayoutEnabled(true);

	addListener(inputListner);

	Ctx.project.addPropertyChangeListener(new PropertyChangeListener() {
		@Override
		public void propertyChange(PropertyChangeEvent e) {
			EditorLogger.debug("ScnWidget Listener: " + e.getPropertyName());

			if (e.getPropertyName().equals(Project.NOTIFY_SCENE_SELECTED)) {
				if (!projectLoadedFlag)
					setSelectedScene(Ctx.project.getSelectedScene());
			} else if (e.getPropertyName().equals(Project.NOTIFY_ACTOR_SELECTED)) {
				if (!projectLoadedFlag)
					setSelectedActor(Ctx.project.getSelectedActor());
			} else if (e.getPropertyName().equals(Project.NOTIFY_ANIM_SELECTED)) {
				if (!projectLoadedFlag && Ctx.project.getSelectedFA() != null)
					setSelectedFA(Ctx.project.getSelectedFA());
			} else if (e.getPropertyName().equals(Project.NOTIFY_PROJECT_LOADED)) {
				projectLoadedFlag = true;
			} else if (e.getPropertyName().equals("scene")) {
				setSelectedScene(Ctx.project.getSelectedScene());
				setSelectedActor(Ctx.project.getSelectedActor());
			} else if (e.getPropertyName().equals("init_animation")) {
				if (!inScene)
					setSelectedFA(null);
			}
		}
	});

	showSpriteBounds = Boolean
			.parseBoolean(Ctx.project.getEditorConfig().getProperty("view.showSpriteBounds", "true"));
	inScene = Boolean.parseBoolean(Ctx.project.getEditorConfig().getProperty("view.inScene", "false"));
	animation = Boolean.parseBoolean(Ctx.project.getEditorConfig().getProperty("view.animation", "true"));

	scnMoveIcon = Ctx.assetManager.getIcon("scn_move");
	scnRotateIcon = Ctx.assetManager.getIcon("scn_rotate");
	scnScaleLockIcon = Ctx.assetManager.getIcon("scn_scale_lock");
	scnScaleIcon = Ctx.assetManager.getIcon("scn_scale");
}