C# 클래스 Nez.UI.Element

상속: ILayout
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_debug bool
_layoutEnabled bool
_needsLayout bool
_visible bool
originX float
rotation float
scaleX float
stage Stage
touchable Touchable

공개 메소드들

메소드 설명
clipBegin ( Batcher batcher ) : bool

Calls clipBegin(Batcher, float, float, float, float) to clip this actor's bounds

clipBegin ( Batcher batcher, float x, float y, float width, float height ) : bool

Clips the specified screen aligned rectangle, specified relative to the transform matrix of the stage's Batch. The transform matrix and the stage's camera must not have rotational components. Calling this method must be followed by a call to clipEnd() if true is returned.

clipEnd ( Batcher batcher ) : void

Ends clipping begun by clipBegin(Batcher, float, float, float, float)

debugRender ( Graphics graphics ) : void

Draws this element's debug lines

draw ( Graphics graphics, float parentAlpha ) : void

If this method is overridden, the super method or {@link #validate()} should be called to ensure the widget is laid out.

getBottom ( ) : float

Returns y plus height

getColor ( ) : Color

Returns the color the element will be tinted when drawn

getDebug ( ) : bool
getHeight ( ) : float
getOriginX ( ) : float
getOriginY ( ) : float
getParent ( ) : Group

Returns the parent element, or null if not in a group

getRight ( ) : float

Returns x plus width

getRotation ( ) : float
getScaleX ( ) : float
getScaleY ( ) : float
getStage ( ) : Stage

Returns the stage that this element is currently in, or null if not in a stage.

getTouchable ( ) : Touchable
getWidth ( ) : float
getX ( ) : float

Returns the X position of the element's left edge

getX ( int alignment ) : float

Returns the X position of the specified {@link Align alignment}.

getY ( ) : float

Returns the Y position of the element's bottom edge

getY ( int alignment ) : float

Returns the Y position of the specified {@link Align alignment}

hasParent ( ) : bool

Returns true if the element's parent is not null

hit ( Vector2 point ) : Element
invalidate ( ) : void
invalidateHierarchy ( ) : void
isTouchable ( ) : bool

Returns true if input events are processed by this element.

isVisible ( ) : bool
layout ( ) : void
localToAscendantCoordinates ( Element ascendant, Vector2 localCoords ) : Vector2

Converts coordinates for this element to those of a parent element. The ascendant does not need to be a direct parent

localToParentCoordinates ( Vector2 localCoords ) : Vector2

Transforms the specified point in the element's coordinates to be in the parent's coordinates.

localToStageCoordinates ( Vector2 localCoords ) : Vector2

Transforms the specified point in the element's coordinates to be in the stage's coordinates

moveBy ( float x, float y ) : void

Add x and y to current position

pack ( ) : void
parentToLocalCoordinates ( Vector2 parentCoords ) : Vector2

Converts the coordinates given in the parent's coordinate system to this element's coordinate system.

remove ( ) : bool

Removes this element from its parent, if it has a parent

rotateBy ( float amountInDegrees ) : void

Adds the specified rotation to the current rotation

scaleBy ( float scale ) : void

Adds the specified scale to the current scale

scaleBy ( float scaleX, float scaleY ) : void

Adds the specified scale to the current scale

screenToLocalCoordinates ( Vector2 screenCoords ) : Vector2

Transforms the specified point in screen coordinates to the element's local coordinate system

setBounds ( float x, float y, float width, float height ) : void

Sets the x, y, width, and height.

setColor ( Color color ) : void
setDebug ( bool enabled ) : void

If true, {@link #debugDraw} will be called for this element

setHeight ( float height ) : void
setIsVisible ( bool visible ) : void
setOrigin ( float originX, float originY ) : void

Sets the origin position which is relative to the element's bottom left corner

setOrigin ( int alignment ) : void

Sets the origin position to the specified {@link Align alignment}.

setOriginX ( float originX ) : void
setOriginY ( float originY ) : void
setPosition ( float x, float y ) : Element

Sets the position of the element's bottom left corner

setPosition ( float x, float y, int alignment ) : void

Sets the position using the specified {@link Align alignment}. Note this may set the position to non-integer coordinates

setRotation ( float degrees ) : void
setScale ( float scaleXY ) : void

Sets the scale for both X and Y

setScale ( float scaleX, float scaleY ) : void

Sets the scale X and scale Y

setScaleX ( float scaleX ) : void
setScaleY ( float scaleY ) : void
setSize ( float width, float height ) : void
setTouchable ( Touchable touchable ) : void

Determines how touch events are distributed to this element. Default is {@link Touchable#enabled}.

setVisible ( bool visible ) : void

If false, the element will not be drawn and will not receive touch events. Default is true.

setWidth ( float width ) : void
setX ( float x ) : Element
setY ( float y ) : Element
setZIndex ( int index ) : void

Sets the z-index of this element. The z-index is the index into the parent's {@link Group#getChildren() children}, where a lower index is below a higher index. Setting a z-index higher than the number of children will move the child to the front. Setting a z-index less than zero is invalid.

stageToLocalCoordinates ( Vector2 stageCoords ) : Vector2

Transforms the specified point in the stage's coordinates to the element's local coordinate system.

toBack ( ) : void

Changes the z-order for this element so it is in back of all siblings

toFront ( ) : void

Changes the z-order for this element so it is in front of all siblings

validate ( ) : void

보호된 메소드들

메소드 설명
distanceOutsideBoundsToPoint ( Vector2 point ) : float

returns the distance from point to the bounds of element in the largest dimension or a negative number if the point is inside the bounds. Note that point should be in the element's coordinate system already.

positionChanged ( ) : void
rotationChanged ( ) : void
sizeChanged ( ) : void

비공개 메소드들

메소드 설명
areParentsVisible ( ) : bool

returns true if this Element and all parent Elements are visible

setParent ( Group parent ) : void

Called by the framework when an element is added to or removed from a group.

setStage ( Stage stage ) : void

Called by the framework when this element or any parent is added to a group that is in the stage. stage May be null if the element or any parent is no longer in a stage

메소드 상세

clipBegin() 공개 메소드

Calls clipBegin(Batcher, float, float, float, float) to clip this actor's bounds
public clipBegin ( Batcher batcher ) : bool
batcher Batcher
리턴 bool

clipBegin() 공개 메소드

Clips the specified screen aligned rectangle, specified relative to the transform matrix of the stage's Batch. The transform matrix and the stage's camera must not have rotational components. Calling this method must be followed by a call to clipEnd() if true is returned.
public clipBegin ( Batcher batcher, float x, float y, float width, float height ) : bool
batcher Batcher
x float
y float
width float
height float
리턴 bool

clipEnd() 공개 메소드

Ends clipping begun by clipBegin(Batcher, float, float, float, float)
public clipEnd ( Batcher batcher ) : void
batcher Batcher
리턴 void

debugRender() 공개 메소드

Draws this element's debug lines
public debugRender ( Graphics graphics ) : void
graphics Graphics Graphics.
리턴 void

distanceOutsideBoundsToPoint() 보호된 메소드

returns the distance from point to the bounds of element in the largest dimension or a negative number if the point is inside the bounds. Note that point should be in the element's coordinate system already.
protected distanceOutsideBoundsToPoint ( Vector2 point ) : float
point Vector2
리턴 float

draw() 공개 메소드

If this method is overridden, the super method or {@link #validate()} should be called to ensure the widget is laid out.
public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics Graphics.
parentAlpha float Parent alpha.
리턴 void

getBottom() 공개 메소드

Returns y plus height
public getBottom ( ) : float
리턴 float

getColor() 공개 메소드

Returns the color the element will be tinted when drawn
public getColor ( ) : Color
리턴 Color

getDebug() 공개 메소드

public getDebug ( ) : bool
리턴 bool

getHeight() 공개 메소드

public getHeight ( ) : float
리턴 float

getOriginX() 공개 메소드

public getOriginX ( ) : float
리턴 float

getOriginY() 공개 메소드

public getOriginY ( ) : float
리턴 float

getParent() 공개 메소드

Returns the parent element, or null if not in a group
public getParent ( ) : Group
리턴 Group

getRight() 공개 메소드

Returns x plus width
public getRight ( ) : float
리턴 float

getRotation() 공개 메소드

public getRotation ( ) : float
리턴 float

getScaleX() 공개 메소드

public getScaleX ( ) : float
리턴 float

getScaleY() 공개 메소드

public getScaleY ( ) : float
리턴 float

getStage() 공개 메소드

Returns the stage that this element is currently in, or null if not in a stage.
public getStage ( ) : Stage
리턴 Stage

getTouchable() 공개 메소드

public getTouchable ( ) : Touchable
리턴 Touchable

getWidth() 공개 메소드

public getWidth ( ) : float
리턴 float

getX() 공개 메소드

Returns the X position of the element's left edge
public getX ( ) : float
리턴 float

getX() 공개 메소드

Returns the X position of the specified {@link Align alignment}.
public getX ( int alignment ) : float
alignment int Alignment.
리턴 float

getY() 공개 메소드

Returns the Y position of the element's bottom edge
public getY ( ) : float
리턴 float

getY() 공개 메소드

Returns the Y position of the specified {@link Align alignment}
public getY ( int alignment ) : float
alignment int Alignment.
리턴 float

hasParent() 공개 메소드

Returns true if the element's parent is not null
public hasParent ( ) : bool
리턴 bool

hit() 공개 메소드

public hit ( Vector2 point ) : Element
point Vector2
리턴 Element

invalidate() 공개 메소드

public invalidate ( ) : void
리턴 void

invalidateHierarchy() 공개 메소드

public invalidateHierarchy ( ) : void
리턴 void

isTouchable() 공개 메소드

Returns true if input events are processed by this element.
public isTouchable ( ) : bool
리턴 bool

isVisible() 공개 메소드

public isVisible ( ) : bool
리턴 bool

layout() 공개 메소드

public layout ( ) : void
리턴 void

localToAscendantCoordinates() 공개 메소드

Converts coordinates for this element to those of a parent element. The ascendant does not need to be a direct parent
public localToAscendantCoordinates ( Element ascendant, Vector2 localCoords ) : Vector2
ascendant Element Ascendant.
localCoords Vector2 Local coords.
리턴 Vector2

localToParentCoordinates() 공개 메소드

Transforms the specified point in the element's coordinates to be in the parent's coordinates.
public localToParentCoordinates ( Vector2 localCoords ) : Vector2
localCoords Vector2 Local coords.
리턴 Vector2

localToStageCoordinates() 공개 메소드

Transforms the specified point in the element's coordinates to be in the stage's coordinates
public localToStageCoordinates ( Vector2 localCoords ) : Vector2
localCoords Vector2 Local coords.
리턴 Vector2

moveBy() 공개 메소드

Add x and y to current position
public moveBy ( float x, float y ) : void
x float The x coordinate.
y float The y coordinate.
리턴 void

pack() 공개 메소드

public pack ( ) : void
리턴 void

parentToLocalCoordinates() 공개 메소드

Converts the coordinates given in the parent's coordinate system to this element's coordinate system.
public parentToLocalCoordinates ( Vector2 parentCoords ) : Vector2
parentCoords Vector2 Parent coords.
리턴 Vector2

positionChanged() 보호된 메소드

protected positionChanged ( ) : void
리턴 void

remove() 공개 메소드

Removes this element from its parent, if it has a parent
public remove ( ) : bool
리턴 bool

rotateBy() 공개 메소드

Adds the specified rotation to the current rotation
public rotateBy ( float amountInDegrees ) : void
amountInDegrees float Amount in degrees.
리턴 void

rotationChanged() 보호된 메소드

protected rotationChanged ( ) : void
리턴 void

scaleBy() 공개 메소드

Adds the specified scale to the current scale
public scaleBy ( float scale ) : void
scale float Scale.
리턴 void

scaleBy() 공개 메소드

Adds the specified scale to the current scale
public scaleBy ( float scaleX, float scaleY ) : void
scaleX float Scale x.
scaleY float Scale y.
리턴 void

screenToLocalCoordinates() 공개 메소드

Transforms the specified point in screen coordinates to the element's local coordinate system
public screenToLocalCoordinates ( Vector2 screenCoords ) : Vector2
screenCoords Vector2 Screen coords.
리턴 Vector2

setBounds() 공개 메소드

Sets the x, y, width, and height.
public setBounds ( float x, float y, float width, float height ) : void
x float The x coordinate.
y float The y coordinate.
width float Width.
height float Height.
리턴 void

setColor() 공개 메소드

public setColor ( Color color ) : void
color Color
리턴 void

setDebug() 공개 메소드

If true, {@link #debugDraw} will be called for this element
public setDebug ( bool enabled ) : void
enabled bool Enabled.
리턴 void

setHeight() 공개 메소드

public setHeight ( float height ) : void
height float
리턴 void

setIsVisible() 공개 메소드

public setIsVisible ( bool visible ) : void
visible bool
리턴 void

setOrigin() 공개 메소드

Sets the origin position which is relative to the element's bottom left corner
public setOrigin ( float originX, float originY ) : void
originX float Origin x.
originY float Origin y.
리턴 void

setOrigin() 공개 메소드

Sets the origin position to the specified {@link Align alignment}.
public setOrigin ( int alignment ) : void
alignment int Alignment.
리턴 void

setOriginX() 공개 메소드

public setOriginX ( float originX ) : void
originX float
리턴 void

setOriginY() 공개 메소드

public setOriginY ( float originY ) : void
originY float
리턴 void

setPosition() 공개 메소드

Sets the position of the element's bottom left corner
public setPosition ( float x, float y ) : Element
x float The x coordinate.
y float The y coordinate.
리턴 Element

setPosition() 공개 메소드

Sets the position using the specified {@link Align alignment}. Note this may set the position to non-integer coordinates
public setPosition ( float x, float y, int alignment ) : void
x float The x coordinate.
y float The y coordinate.
alignment int Alignment.
리턴 void

setRotation() 공개 메소드

public setRotation ( float degrees ) : void
degrees float
리턴 void

setScale() 공개 메소드

Sets the scale for both X and Y
public setScale ( float scaleXY ) : void
scaleXY float Scale X.
리턴 void

setScale() 공개 메소드

Sets the scale X and scale Y
public setScale ( float scaleX, float scaleY ) : void
scaleX float Scale x.
scaleY float Scale y.
리턴 void

setScaleX() 공개 메소드

public setScaleX ( float scaleX ) : void
scaleX float
리턴 void

setScaleY() 공개 메소드

public setScaleY ( float scaleY ) : void
scaleY float
리턴 void

setSize() 공개 메소드

public setSize ( float width, float height ) : void
width float
height float
리턴 void

setTouchable() 공개 메소드

Determines how touch events are distributed to this element. Default is {@link Touchable#enabled}.
public setTouchable ( Touchable touchable ) : void
touchable Touchable Touchable.
리턴 void

setVisible() 공개 메소드

If false, the element will not be drawn and will not receive touch events. Default is true.
public setVisible ( bool visible ) : void
visible bool Visible.
리턴 void

setWidth() 공개 메소드

public setWidth ( float width ) : void
width float
리턴 void

setX() 공개 메소드

public setX ( float x ) : Element
x float
리턴 Element

setY() 공개 메소드

public setY ( float y ) : Element
y float
리턴 Element

setZIndex() 공개 메소드

Sets the z-index of this element. The z-index is the index into the parent's {@link Group#getChildren() children}, where a lower index is below a higher index. Setting a z-index higher than the number of children will move the child to the front. Setting a z-index less than zero is invalid.
public setZIndex ( int index ) : void
index int Index.
리턴 void

sizeChanged() 보호된 메소드

protected sizeChanged ( ) : void
리턴 void

stageToLocalCoordinates() 공개 메소드

Transforms the specified point in the stage's coordinates to the element's local coordinate system.
public stageToLocalCoordinates ( Vector2 stageCoords ) : Vector2
stageCoords Vector2 Stage coords.
리턴 Vector2

toBack() 공개 메소드

Changes the z-order for this element so it is in back of all siblings
public toBack ( ) : void
리턴 void

toFront() 공개 메소드

Changes the z-order for this element so it is in front of all siblings
public toFront ( ) : void
리턴 void

validate() 공개 메소드

public validate ( ) : void
리턴 void

프로퍼티 상세

_debug 보호되어 있는 프로퍼티

protected bool _debug
리턴 bool

_layoutEnabled 보호되어 있는 프로퍼티

protected bool _layoutEnabled
리턴 bool

_needsLayout 보호되어 있는 프로퍼티

protected bool _needsLayout
리턴 bool

_visible 보호되어 있는 프로퍼티

protected bool _visible
리턴 bool

originX 보호되어 있는 프로퍼티

protected float originX
리턴 float

rotation 보호되어 있는 프로퍼티

protected float rotation
리턴 float

scaleX 보호되어 있는 프로퍼티

protected float scaleX
리턴 float

stage 보호되어 있는 프로퍼티

protected Stage stage
리턴 Stage

touchable 보호되어 있는 프로퍼티

protected Touchable touchable
리턴 Touchable