Package com.jme3.ui
Class Picture
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Geometry
com.jme3.ui.Picture
- All Implemented Interfaces:
- HasLocalTransform,- CloneableSmartAsset,- Collidable,- Savable,- JmeCloneable,- Cloneable
A 
Picture represents a 2D image drawn on the screen.
 It can be used to represent sprites or other background elements.- 
Nested Class SummaryNested classes/interfaces inherited from class com.jme3.scene.SpatialSpatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
- 
Field SummaryFields inherited from class com.jme3.scene.GeometrycachedWorldMat, groupNode, ignoreTransform, lodLevel, material, mesh, SAVABLE_VERSION, startIndexFields inherited from class com.jme3.scene.SpatialbatchHint, controls, cullHint, frustrumIntersects, key, localLights, localOverrides, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_CHILD_LIGHTLIST, RF_LIGHTLIST, RF_MATPARAM_OVERRIDE, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldOverrides, worldTransform
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfloatReturn the height of the picture.floatgetWidth()Return the width of the picture.voidsetHeight(float height) Set the height in pixels of the picture, if the height does not match the texture's height, then the texture will be scaled to fit the picture.voidsetImage(AssetManager assetManager, String imgName, boolean useAlpha) Set the image to put on the picture.voidsetPosition(float x, float y) Set the position of the picture in pixels.voidsetTexture(AssetManager assetManager, Texture2D tex, boolean useAlpha) Set the texture to put on the picture.voidsetWidth(float width) Set the width in pixels of the picture, if the width does not match the texture's width, then the texture will be scaled to fit the picture.Methods inherited from class com.jme3.scene.GeometryassociateWithGroupNode, breadthFirstTraversal, checkCulling, clone, clone, cloneFields, collideWith, computeWorldMatrix, deepClone, depthFirstTraversal, getFallbackMorphTarget, getLodLevel, getMaterial, getMesh, getModelBound, getMorphState, getMorphState, getNbSimultaneousGPUMorph, getTriangleCount, getVertexCount, getWorldMatrix, isBatched, isDirtyMorph, isGrouped, isIgnoreTransform, oldDeepClone, read, removeFromParent, setDirtyMorph, setFallbackMorphTarget, setIgnoreTransform, setLodLevel, setMaterial, setMesh, setModelBound, setMorphState, setMorphState, setNbSimultaneousGPUMorph, setParent, unassociateFromGroupNode, updateModelBound, updateWorldBound, updateWorldLightList, updateWorldTransforms, writeMethods inherited from class com.jme3.scene.SpatialaddControl, addControlAt, addLight, addMatParamOverride, breadthFirstTraversal, center, clearMatParamOverrides, depthFirstTraversal, forceRefresh, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalMatParamOverrides, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldMatParamOverrides, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, jmeClone, localToWorld, lookAt, matches, move, move, oldClone, removeControl, removeControl, removeLight, removeMatParamOverride, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLightListRefresh, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setMatParamOverrideRefresh, setName, setQueueBucket, setRequiresUpdates, setShadowMode, setTransformRefresh, setUserData, toString, updateGeometricState, updateLogicalState, updateMatParamOverrides, worldToLocal
- 
Constructor Details- 
PictureCreate a named picture. By default, a picture's width and height are 1, and its position is 0, 0.- Parameters:
- name- the name of the picture in the scene graph
- flipY- If true, the Y coordinates of the texture will be flipped.
 
- 
PictureCreates a named picture. By default, a picture's width and height are 1, and its position is 0, 0. The image texture coordinates will not be flipped.- Parameters:
- name- the name of the picture in the scene graph
 
- 
Pictureprotected Picture()Serialization only. Do not use.
 
- 
- 
Method Details- 
getHeightpublic float getHeight()Return the height of the picture.- Returns:
- the height (in pixels)
 
- 
getWidthpublic float getWidth()Return the width of the picture.- Returns:
- the width (in pixels)
 
- 
setWidthpublic void setWidth(float width) Set the width in pixels of the picture, if the width does not match the texture's width, then the texture will be scaled to fit the picture.- Parameters:
- width- the width to set.
 
- 
setHeightpublic void setHeight(float height) Set the height in pixels of the picture, if the height does not match the texture's height, then the texture will be scaled to fit the picture.- Parameters:
- height- the height to set.
 
- 
setPositionpublic void setPosition(float x, float y) Set the position of the picture in pixels. The origin (0, 0) is at the bottom-left of the screen.- Parameters:
- x- The x coordinate
- y- The y coordinate
 
- 
setImageSet the image to put on the picture.- Parameters:
- assetManager- The- AssetManagerto use to load the image.
- imgName- The image name.
- useAlpha- If true, the picture will appear transparent and allow objects behind it to appear through. If false, the transparent portions will be the image's color at that pixel.
 
- 
setTextureSet the texture to put on the picture.- Parameters:
- assetManager- The- AssetManagerto use to load the material.
- tex- The texture
- useAlpha- If true, the picture will appear transparent and allow objects behind it to appear through. If false, the transparent portions will be the image's color at that pixel.
 
 
-