libgdx API

com.badlogic.gdx.scenes.scene2d.ui
Class Image

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Actor
      extended by com.badlogic.gdx.scenes.scene2d.ui.Widget
          extended by com.badlogic.gdx.scenes.scene2d.ui.Image
All Implemented Interfaces:
Layout

public class Image
extends Widget


Nested Class Summary
static class Image.Scaling
           
 
Field Summary
 
Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.Widget
invalidated
 
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor
actions, color, height, name, originX, originY, parent, rotation, scaleX, scaleY, touchable, visible, width, x, y
 
Constructor Summary
Image(NinePatch patch)
           
Image(NinePatch patch, Image.Scaling scaling)
           
Image(NinePatch patch, Image.Scaling scaling, int align)
           
Image(NinePatch patch, Image.Scaling scaling, int align, java.lang.String name)
           
Image(NinePatch patch, Image.Scaling scaling, java.lang.String name)
           
Image(TextureRegion region)
           
Image(TextureRegion region, Image.Scaling scaling)
           
Image(TextureRegion region, Image.Scaling scaling, int align)
           
Image(TextureRegion region, Image.Scaling scaling, int align, java.lang.String name)
           
Image(TextureRegion region, Image.Scaling scaling, java.lang.String name)
           
 
Method Summary
 void draw(SpriteBatch batch, float parentAlpha)
          Draws the Actor.
 float getMinHeight()
           
 float getMinWidth()
           
 float getPrefHeight()
           
 float getPrefWidth()
           
 void layout()
          Positions and sizes each child of this actor.
 void setPatch(NinePatch patch)
           
 void setRegion(TextureRegion region)
           
 boolean touchDown(float x, float y, int pointer)
           
 void touchDragged(float x, float y, int pointer)
           
 void touchUp(float x, float y, int pointer)
           
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Widget
getMaxHeight, getMaxWidth, hit, invalidate, invalidateHierarchy
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
act, action, clearActions, isMarkedToRemove, keyDown, keyTyped, keyUp, markToRemove, remove, scrolled, toLocalCoordinates, toString, touchMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Image

public Image(TextureRegion region)

Image

public Image(TextureRegion region,
             Image.Scaling scaling)

Image

public Image(TextureRegion region,
             Image.Scaling scaling,
             int align)

Image

public Image(TextureRegion region,
             Image.Scaling scaling,
             java.lang.String name)

Image

public Image(TextureRegion region,
             Image.Scaling scaling,
             int align,
             java.lang.String name)

Image

public Image(NinePatch patch)

Image

public Image(NinePatch patch,
             Image.Scaling scaling)

Image

public Image(NinePatch patch,
             Image.Scaling scaling,
             int align)

Image

public Image(NinePatch patch,
             Image.Scaling scaling,
             java.lang.String name)

Image

public Image(NinePatch patch,
             Image.Scaling scaling,
             int align,
             java.lang.String name)
Method Detail

layout

public void layout()
Description copied from interface: Layout
Positions and sizes each child of this actor. Subsequent calls will not have any affect unless Layout.invalidate() is called.


draw

public void draw(SpriteBatch batch,
                 float parentAlpha)
Description copied from class: Actor
Draws the Actor. The spriteBatch is configured so that the Actor can draw in its parents coordinate system. The parent's alpha is passed to the method in order for the Actor to multiply it with its own alpha. This will allow FadeIn and other Actions to have an effect even if they are only set on the parent of the Actor.

Specified by:
draw in class Actor
Parameters:
batch - the spritebatch to render with
parentAlpha - the parent's alpha value.

setRegion

public void setRegion(TextureRegion region)

setPatch

public void setPatch(NinePatch patch)

getMinWidth

public float getMinWidth()
Specified by:
getMinWidth in interface Layout
Overrides:
getMinWidth in class Widget

getMinHeight

public float getMinHeight()
Specified by:
getMinHeight in interface Layout
Overrides:
getMinHeight in class Widget

getPrefWidth

public float getPrefWidth()

getPrefHeight

public float getPrefHeight()

touchDown

public boolean touchDown(float x,
                         float y,
                         int pointer)
Specified by:
touchDown in class Actor

touchUp

public void touchUp(float x,
                    float y,
                    int pointer)
Specified by:
touchUp in class Actor

touchDragged

public void touchDragged(float x,
                         float y,
                         int pointer)
Specified by:
touchDragged in class Actor

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)