Package net.mcreator.element.parts.gui
Class GUIComponent
java.lang.Object
net.mcreator.element.parts.gui.GUIComponent
- All Implemented Interfaces:
Comparable<GUIComponent>
- Direct Known Subclasses:
Checkbox,EntityModel,GUIComponent.Unknown,Image,ImageButton,Label,SizedComponent,Slot,Sprite
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanintint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal booleanabstract intabstract StringgetName()Returns the name of the component.abstract intReturns the priority for when this component should be drawn in the UI, to represent how Minecraft draws components in the game.abstract intfinal intgetX()final intgetY()final intgx(int width) final intgy(int height) final inthashCode()booleanabstract voidpaintComponent(int cx, int cy, WYSIWYGEditor wysiwygEditor, Graphics2D g) static voidregisterCustomComponent(Class<? extends GUIComponent> type) toString()
-
Field Details
-
anchorPoint
-
x
public int x -
y
public int y -
locked
public boolean locked -
uuid
-
-
Constructor Details
-
GUIComponent
public GUIComponent(int x, int y)
-
-
Method Details
-
getName
Returns the name of the component. Name should be Java and registry name compatible.The name should be unique for the components that need it.
- Returns:
- Component name
-
paintComponent
-
getWidth
-
getHeight
-
getWeight
public abstract int getWeight()Returns the priority for when this component should be drawn in the UI, to represent how Minecraft draws components in the game.- Returns:
- The priority of the component (lower means it will be rendered closer to the screen and higher means it will "sink" more behind other components)
-
isSizeKnown
public boolean isSizeKnown() -
getX
public final int getX() -
getY
public final int getY() -
gx
public final int gx(int width) -
gy
public final int gy(int height) -
getAnchorPoint
-
compareTo
- Specified by:
compareToin interfaceComparable<GUIComponent>
-
hashCode
public final int hashCode() -
equals
-
toString
-
registerCustomComponent
-