libwiigui 1.07
libwiigui is a GUI library for the Wii
 
Loading...
Searching...
No Matches
GuiImage Class Reference

Display, manage, and manipulate images in the GUI. More...

#include <gui_image.h>

Inheritance diagram for GuiImage:
GuiElement

Public Member Functions

 GuiImage ()
 Constructor. More...
 
 GuiImage (GuiImageData *img)
 
 GuiImage (u8 *img, int w, int h)
 
 GuiImage (int w, int h, GXColor c)
 
 ~GuiImage ()
 Destructor. More...
 
void SetAngle (float a)
 
void SetTile (int t)
 
void Draw () override
 Constantly called to draw the image. More...
 
u8 * GetImage ()
 
void SetImage (GuiImageData *img)
 
void SetImage (u8 *img, int w, int h)
 
GXColor GetPixel (int x, int y)
 
void SetPixel (int x, int y, GXColor color)
 
void ColorStripe (int s)
 
void SetStripe (int s)
 
- Public Member Functions inherited from GuiElement
 GuiElement ()
 Constructor. More...
 
virtual ~GuiElement ()
 Destructor. More...
 
void SetParent (GuiElement *e)
 
GuiElementGetParent ()
 
int GetLeft ()
 
int GetTop ()
 
void SetMinY (int y)
 
int GetMinY ()
 
void SetMaxY (int y)
 
int GetMaxY ()
 
void SetMinX (int x)
 
int GetMinX ()
 
void SetMaxX (int x)
 
int GetMaxX ()
 
int GetWidth ()
 
int GetHeight ()
 
void SetSize (int w, int h)
 
bool IsVisible ()
 
bool IsSelectable ()
 
bool IsClickable ()
 
bool IsHoldable ()
 
void SetSelectable (bool s)
 
void SetClickable (bool c)
 
void SetHoldable (bool h)
 
STATE GetState ()
 
int GetStateChan ()
 
void SetAlpha (int a)
 
int GetAlpha ()
 
void SetScale (float s)
 
void SetScaleX (float s)
 
void SetScaleY (float s)
 
void SetScale (int w, int h)
 
float GetScale ()
 
float GetScaleX ()
 
float GetScaleY ()
 
void SetTrigger (GuiTrigger *t)
 
void SetTrigger (u8 i, GuiTrigger *t)
 
bool Rumble ()
 
void SetRumble (bool r)
 
void SetEffect (int e, int a, int t=0)
 
void SetEffectOnOver (int e, int a, int t=0)
 
void SetEffectGrow ()
 Shortcut to SetEffectOnOver(EFFECT_SCALE, 4, 110)
 
int GetEffect ()
 
bool IsInside (int x, int y)
 
void SetPosition (int x, int y)
 
void UpdateEffects ()
 
void SetUpdateCallback (UpdateCallback u)
 
int IsFocused ()
 
virtual void SetVisible (bool v)
 
virtual void SetFocus (int f)
 
virtual void SetState (STATE s, int c=-1)
 
virtual void ResetState ()
 Resets the element's state to STATE::DEFAULT. More...
 
virtual int GetSelected ()
 
virtual void SetAlignment (ALIGN_H hor, ALIGN_V vert)
 
virtual void ResetText ()
 Called when the language has changed, to obtain new text values for all text elements. More...
 
virtual void Update (GuiTrigger *t)
 
virtual void Draw ()=0
 Called constantly to redraw the element. More...
 
virtual void DrawTooltip ()
 Called constantly to redraw the element's tooltip. More...
 

Protected Attributes

IMAGE imgType
 Type of image data (TEXTURE, COLOR, DATA)
 
u8 * image
 Poiner to image data. May be shared with GuiImageData data.
 
f32 imageangle
 Angle to draw the image.
 
int tile
 Number of times to draw (tile) the image horizontally.
 
int stripe
 Alpha value (0-255) to apply a stripe effect to the texture.
 
- Protected Attributes inherited from GuiElement
GuiTriggertrigger [MAX_TRIGGERS]
 GuiTriggers (input actions) that this element responds to.
 
UpdateCallback updateCB
 Callback function to call when this element is updated.
 
GuiElementparentElement
 Parent element.
 
int focus
 Element focus (-1 = focus disabled, 0 = not focused, 1 = focused)
 
int width
 Element width.
 
int height
 Element height.
 
int xoffset
 Element X offset.
 
int yoffset
 Element Y offset.
 
int ymin
 Element's min Y offset allowed.
 
int ymax
 Element's max Y offset allowed.
 
int xmin
 Element's min X offset allowed.
 
int xmax
 Element's max X offset allowed.
 
int xoffsetDyn
 Element X offset, dynamic (added to xoffset value for animation effects)
 
int yoffsetDyn
 Element Y offset, dynamic (added to yoffset value for animation effects)
 
int alpha
 Element alpha value (0-255)
 
int alphaDyn
 Element alpha, dynamic (multiplied by alpha value for blending/fading effects)
 
f32 xscale
 Element X scale (1 = 100%)
 
f32 yscale
 Element Y scale (1 = 100%)
 
f32 scaleDyn
 Element scale, dynamic (multiplied by alpha value for blending/fading effects)
 
int effects
 Currently enabled effect(s). 0 when no effects are enabled.
 
int effectAmount
 Effect amount. Used by different effects for different purposes.
 
int effectTarget
 Effect target amount. Used by different effects for different purposes.
 
int effectsOver
 Effects to enable when wiimote cursor is over this element. Copied to effects variable on over event.
 
int effectAmountOver
 EffectAmount to set when wiimote cursor is over this element.
 
int effectTargetOver
 EffectTarget to set when wiimote cursor is over this element.
 
ALIGN_H alignmentHor
 Horizontal element alignment, respective to parent element (LEFT, RIGHT, CENTRE)
 
ALIGN_V alignmentVert
 Horizontal element alignment, respective to parent element (TOP, BOTTOM, MIDDLE)
 
STATE state
 Element state (DEFAULT, SELECTED, CLICKED, DISABLED)
 
int stateChan
 Which controller channel is responsible for the last change in state.
 
bool selectable
 Whether or not this element selectable (can change to SELECTED state)
 
bool clickable
 Whether or not this element is clickable (can change to CLICKED state)
 
bool holdable
 Whether or not this element is holdable (can change to HELD state)
 
bool visible
 Visibility of the element. If false, Draw() is skipped.
 
bool rumble
 Wiimote rumble (on/off) - set to on when this element requests a rumble event.
 

Detailed Description

Display, manage, and manipulate images in the GUI.

Constructor & Destructor Documentation

◆ GuiImage() [1/4]

GuiImage::GuiImage ( )

Constructor.

Constructor for the GuiImage class.

◆ GuiImage() [2/4]

GuiImage::GuiImage ( GuiImageData img)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
imgPointer to GuiImageData element

◆ GuiImage() [3/4]

GuiImage::GuiImage ( u8 *  img,
int  w,
int  h 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets up a new image from the image data specified

Parameters
img
wImage width
hImage height

◆ GuiImage() [4/4]

GuiImage::GuiImage ( int  w,
int  h,
GXColor  c 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Creates an image filled with the specified color

Parameters
wImage width
hImage height
cImage color

◆ ~GuiImage()

GuiImage::~GuiImage ( )

Destructor.

Destructor for the GuiImage class.

Member Function Documentation

◆ ColorStripe()

void GuiImage::ColorStripe ( int  s)

Directly modifies the image data to create a color-striped effect Alters the RGB values by the specified amount

Parameters
sAmount to increment/decrement the RGB values in the image

◆ Draw()

void GuiImage::Draw ( )
overridevirtual

Constantly called to draw the image.

Draw the button on screen

Implements GuiElement.

◆ GetImage()

u8 * GuiImage::GetImage ( )

Gets the image data

Returns
pointer to image data

◆ GetPixel()

GXColor GuiImage::GetPixel ( int  x,
int  y 
)

Gets the pixel color at the specified coordinates of the image

Parameters
xX coordinate
yY coordinate

◆ SetAngle()

void GuiImage::SetAngle ( float  a)

Sets the image rotation angle for drawing

Parameters
aAngle (in degrees)

◆ SetImage() [1/2]

void GuiImage::SetImage ( GuiImageData img)

Sets up a new image using the GuiImageData object specified

Parameters
imgPointer to GuiImageData object

◆ SetImage() [2/2]

void GuiImage::SetImage ( u8 *  img,
int  w,
int  h 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
imgPointer to image data
wWidth
hHeight

◆ SetPixel()

void GuiImage::SetPixel ( int  x,
int  y,
GXColor  color 
)

Sets the pixel color at the specified coordinates of the image

Parameters
xX coordinate
yY coordinate
colorPixel color

◆ SetStripe()

void GuiImage::SetStripe ( int  s)

Sets a stripe effect on the image, overlaying alpha blended rectangles Does not alter the image data

Parameters
sAlpha amount to draw over the image

◆ SetTile()

void GuiImage::SetTile ( int  t)

Sets the number of times to draw the image horizontally

Parameters
tNumber of times to draw the image

The documentation for this class was generated from the following files: