Path: blob/master/SonicMania/Objects/Menu/UIButtonLabel.c
338 views
// ---------------------------------------------------------------------1// RSDK Project: Sonic Mania2// Object Description: UIButtonLabel Object3// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges4// Decompiled by: Rubberduckycooly & RMGRich5// ---------------------------------------------------------------------67#include "Game.h"89ObjectUIButtonLabel *UIButtonLabel;1011void UIButtonLabel_Update(void)12{13RSDK_THIS(UIButtonLabel);1415if (self->textSprite != UIWidgets->textFrames) {16RSDK.SetSpriteAnimation(UIWidgets->textFrames, self->listID, &self->textAnimator, true, self->frameID);17self->textSprite = UIWidgets->textFrames;18}19}2021void UIButtonLabel_LateUpdate(void) {}2223void UIButtonLabel_StaticUpdate(void) {}2425void UIButtonLabel_Draw(void)26{27RSDK_THIS(UIButtonLabel);2829Vector2 drawPos;30drawPos.x = self->position.x;31drawPos.y = self->position.y;3233RSDK.DrawSprite(&self->frameAnimator, &drawPos, false);34RSDK.DrawSprite(&self->textAnimator, &drawPos, false);35}3637void UIButtonLabel_Create(void *data)38{39RSDK_THIS(UIButtonLabel);4041self->active = ACTIVE_BOUNDS;42self->drawGroup = 2;43self->visible = true;44self->drawFX = FX_FLIP;45self->updateRange.x = 0x800000;46self->updateRange.y = 0x300000;4748RSDK.SetSpriteAnimation(UIButtonLabel->aniFrames, 0, &self->frameAnimator, true, self->type);49RSDK.SetSpriteAnimation(UIWidgets->textFrames, self->listID, &self->textAnimator, true, self->frameID);5051self->textSprite = UIWidgets->textFrames;52}5354void UIButtonLabel_StageLoad(void) { UIButtonLabel->aniFrames = RSDK.LoadSpriteAnimation("UI/ButtonLabel.bin", SCOPE_STAGE); }5556#if GAME_INCLUDE_EDITOR57void UIButtonLabel_EditorDraw(void)58{59RSDK_THIS(UIButtonLabel);6061self->drawGroup = 2;62self->drawFX = FX_FLIP;63self->updateRange.x = 0x800000;64self->updateRange.y = 0x300000;6566RSDK.SetSpriteAnimation(UIButtonLabel->aniFrames, 0, &self->frameAnimator, true, self->type);67RSDK.SetSpriteAnimation(UIWidgets->textFrames, self->listID, &self->textAnimator, true, self->frameID);6869self->textSprite = UIWidgets->textFrames;7071UIButtonLabel_Draw();72}7374void UIButtonLabel_EditorLoad(void) { UIButtonLabel->aniFrames = RSDK.LoadSpriteAnimation("UI/ButtonLabel.bin", SCOPE_STAGE); }75#endif7677void UIButtonLabel_Serialize(void)78{79RSDK_EDITABLE_VAR(UIButtonLabel, VAR_UINT8, type);80RSDK_EDITABLE_VAR(UIButtonLabel, VAR_ENUM, listID);81RSDK_EDITABLE_VAR(UIButtonLabel, VAR_ENUM, frameID);82}838485