Class ItemSlot
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.Stack
com.csse3200.game.components.inventory.ItemSlot
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable,com.badlogic.gdx.scenes.scene2d.utils.Layout
public class ItemSlot
extends com.badlogic.gdx.scenes.scene2d.ui.Stack
A class used to combine all the data necessary to the individual inventory slots
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCount()Get the item countcom.badlogic.gdx.scenes.scene2d.ui.Stackcom.badlogic.gdx.scenes.scene2d.ui.ImageGet the item imagecom.badlogic.gdx.graphics.TextureSet the item texturevoidSet the item countvoidsetDraggable(com.badlogic.gdx.scenes.scene2d.ui.Stack stack) voidsetItemImage(com.badlogic.gdx.scenes.scene2d.ui.Image image) voidMake the slot selectedvoidMake the slot unselectedtoString()Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Stack
add, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, invalidate, layoutMethods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
childrenChanged, draw, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validateMethods inherited from class com.badlogic.gdx.scenes.scene2d.Group
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, clearChildren, computeTransform, debugAll, drawChildren, drawDebug, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, removeActor, removeActor, removeActorAt, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActorMethods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront
-
Constructor Details
-
ItemSlot
Construct an itemSlot with a texture, count and selected state- Parameters:
itemTexture- texture of item's imagecount- count of itemselected- boolean state of whether item slot is selected
-
ItemSlot
public ItemSlot(com.badlogic.gdx.graphics.Texture itemTexture, boolean selected) Construct an itemSlot with a texture and selected state- Parameters:
itemTexture- texture of item's imageselected- boolean state of whether item slot is selected
-
ItemSlot
public ItemSlot(boolean selected) Construct an itemSlot with a selected state- Parameters:
selected- boolean state of whether item slot is selected
-
-
Method Details
-
setCount
Set the item count- Parameters:
count- integer of number of item
-
getCount
Get the item count- Returns:
- count integer of number of item
-
getItemTexture
public com.badlogic.gdx.graphics.Texture getItemTexture()Set the item texture- Returns:
- itemTexture texture of item's image
-
toString
- Overrides:
toStringin classcom.badlogic.gdx.scenes.scene2d.Group
-
getItemImage
public com.badlogic.gdx.scenes.scene2d.ui.Image getItemImage()Get the item image- Returns:
- the item image
-
getDraggable
public com.badlogic.gdx.scenes.scene2d.ui.Stack getDraggable() -
setDraggable
public void setDraggable(com.badlogic.gdx.scenes.scene2d.ui.Stack stack) -
setItemImage
public void setItemImage(com.badlogic.gdx.scenes.scene2d.ui.Image image) -
setSelected
public void setSelected()Make the slot selected -
setUnselected
public void setUnselected()Make the slot unselected
-