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.Stack
com.badlogic.gdx.scenes.scene2d.ui.Image
Get the item imagecom.badlogic.gdx.graphics.Texture
Set the item texturevoid
Set the item countvoid
setDraggable
(com.badlogic.gdx.scenes.scene2d.ui.Stack stack) void
setItemImage
(com.badlogic.gdx.scenes.scene2d.ui.Image image) void
Make the slot selectedvoid
Make the slot unselectedtoString()
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Stack
add, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, invalidate, layout
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
childrenChanged, draw, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate
Methods 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, swapActor
Methods 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
-
getCount
Get the item count- Returns:
- count integer of number of item
-
setCount
Set the item count- Parameters:
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:
toString
in classcom.badlogic.gdx.scenes.scene2d.Group
-
getItemImage
public com.badlogic.gdx.scenes.scene2d.ui.Image getItemImage()Get the item image- Returns:
- the item image
-
setItemImage
public void setItemImage(com.badlogic.gdx.scenes.scene2d.ui.Image image) -
getDraggable
public com.badlogic.gdx.scenes.scene2d.ui.Stack getDraggable() -
setDraggable
public void setDraggable(com.badlogic.gdx.scenes.scene2d.ui.Stack stack) -
setSelected
public void setSelected()Make the slot selected -
setUnselected
public void setUnselected()Make the slot unselected
-