Class Area3D
java.lang.Object
net.risingworld.api.worldelements.GameObject
net.risingworld.api.worldelements.Area3D
-
Nested Class Summary
Nested classes/interfaces inherited from class net.risingworld.api.worldelements.GameObject
GameObject.AttachTarget
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetArea()
Gets the underlyingArea
.int
getColor()
int
boolean
Gets whether this element is always visible (i.e visible through walls etc) or not.boolean
void
setAlwaysVisible
(boolean set) Determines if the element should be always visible (i.e visible through walls etc) or not.void
Sets the underlyingArea
.void
setColor
(float r, float g, float b, float a) Sets the color (RGBA) of the area (the inner part, not the frame).void
setColor
(int color) void
Sets the color (RGBA) of the area (the inner part, not the frame).void
setFrameColor
(float r, float g, float b, float a) Sets the color (RGBA) of the frame.void
setFrameColor
(int color) Sets the color of the frame.void
setFrameColor
(ColorRGBA color) Sets the color of the frame.void
setFrameVisible
(boolean set) void
Updates this element.Methods inherited from class net.risingworld.api.worldelements.GameObject
addChild, addComponent, attachTo, attachTo, deleteAttribute, getAttribute, getAttributes, getChildCount, getChilds, getCollider, getID, getLayer, getLocalPosition, getLocalRotation, getLocalScale, getParent, getPluginID, hasAttribute, hasAttribute, invokeComponentMethod, isActive, isAttached, isColliderVisible, isDisposed, moveToLocalPosition, moveToLocalPosition, moveToLocalPosition, moveToLocalPosition, moveToLocalTransform, readWorldPosition, readWorldRotation, removeAllChilds, removeChild, removeComponent, removeFromParent, rotateToLocalRotation, setActive, setAttribute, setCollider, setColliderVisible, setComponentEnabled, setComponentProperty, setLayer, setLocalPosition, setLocalPosition, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale
-
Constructor Details
-
Area3D
Creates a newArea3D
element which represents an actualArea
. Can be used to visualize anArea
.
Note that changes to theArea
(i.e if you change its coordinates) requires you to update thisArea3D
accordingly.- Parameters:
area
- theArea
you want to represent.
-
-
Method Details
-
setArea
Sets the underlyingArea
.- Parameters:
area
- the new area.
-
getArea
Gets the underlyingArea
.- Returns:
- the area.
-
updateCoordinates
public void updateCoordinates()Updates this element. Call this method if the area coordinates have been changed. Does the same assetArea(getArea());
-
setAlwaysVisible
public void setAlwaysVisible(boolean set) Determines if the element should be always visible (i.e visible through walls etc) or not.- Parameters:
set
- set to true to make this element always visible.
-
isAlwaysVisible
public boolean isAlwaysVisible()Gets whether this element is always visible (i.e visible through walls etc) or not.- Returns:
- true if this element is always visible, false if not.
-
setFrameVisible
public void setFrameVisible(boolean set) -
isFrameVisible
public boolean isFrameVisible() -
setColor
public void setColor(float r, float g, float b, float a) Sets the color (RGBA) of the area (the inner part, not the frame).- Parameters:
r
- the red color value (0-1)g
- the green color value (0-1)b
- the blue color value (0-1)a
- the alpha value (0-1), 0 makes the area invisible, 1 fully opaque.
-
setColor
Sets the color (RGBA) of the area (the inner part, not the frame).- Parameters:
color
- the new color
-
setColor
public void setColor(int color) -
getColor
public int getColor() -
setFrameColor
public void setFrameColor(float r, float g, float b, float a) Sets the color (RGBA) of the frame.- Parameters:
r
- the red color value (0-1)g
- the green color value (0-1)b
- the blue color value (0-1)a
- the alpha value (0-1), 0 makes the frame invisible, 1 fully opaque.
-
setFrameColor
Sets the color of the frame.- Parameters:
color
- the new color
-
setFrameColor
public void setFrameColor(int color) Sets the color of the frame.- Parameters:
color
- the new color as rgba int (e.g 0xFF0000FF)
-
getFrameColor
public int getFrameColor()
-