mirror of
https://github.com/risingPhil/PokeMe64.git
synced 2026-09-12 18:55:26 -05:00
Work on ScrollWidget (Work In Progress/Incomplete)
This commit is contained in:
@@ -2,8 +2,16 @@
|
||||
#define _TESTSCENE_H
|
||||
|
||||
#include "scenes/AbstractUIScene.h"
|
||||
#include "core/RDPQGraphics.h"
|
||||
#include "core/Sprite.h"
|
||||
#include "widget/ScrollWidget.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class ImageWidget;
|
||||
class TextWidget;
|
||||
|
||||
typedef std::vector<IWidget*> WidgetList;
|
||||
|
||||
|
||||
class TestScene : public AbstractUIScene
|
||||
{
|
||||
@@ -17,20 +25,11 @@ public:
|
||||
void render(RDPQGraphics& gfx, const Rectangle& sceneBounds) override;
|
||||
protected:
|
||||
private:
|
||||
rdpq_font_t* arialFont_;
|
||||
uint8_t arialFontId_;
|
||||
uint8_t fontStyleWhite_;
|
||||
ScrollWidget scrollWidget_;
|
||||
WidgetFocusChainSegment scrollWidgetFocusSegment_;
|
||||
WidgetList widgets_;
|
||||
sprite_t* pokeballSprite_;
|
||||
sprite_t* oakSprite_;
|
||||
sprite_t* menu9SliceSprite_;
|
||||
const Rectangle rectBounds_;
|
||||
const Rectangle textRect_;
|
||||
const Rectangle spriteBounds_;
|
||||
Rectangle oakBounds_;
|
||||
Rectangle oakSrcBounds_;
|
||||
const Rectangle menuBounds_;
|
||||
TextRenderSettings textRenderSettings_;
|
||||
const SpriteRenderSettings menuRenderSettings_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -12,6 +12,7 @@ class RDPQGraphics;
|
||||
class IWidget
|
||||
{
|
||||
public:
|
||||
virtual ~IWidget(){}
|
||||
/**
|
||||
* @brief Returns whether the widget is currently focused
|
||||
*/
|
||||
|
||||
@@ -33,9 +33,12 @@ public:
|
||||
uint32_t getDurationInMs() const override;
|
||||
|
||||
void start(const Point& startPoint, const Point& endPoint);
|
||||
void extend(const Point& endPoint);
|
||||
protected:
|
||||
void apply(float pos) override;
|
||||
private:
|
||||
Point calculatePoint(float pos);
|
||||
|
||||
ScrollWidget* list_;
|
||||
Point windowStartPoint_;
|
||||
Point windowEndPoint_;
|
||||
@@ -69,6 +72,7 @@ public:
|
||||
|
||||
void addWidget(IWidget* widget);
|
||||
void removeWidget(IWidget* widget);
|
||||
void clearWidgets();
|
||||
|
||||
bool handleUserInput(const joypad_inputs_t& userInput) override;
|
||||
void render(RDPQGraphics& gfx, const Rectangle& parentBounds) override;
|
||||
|
||||
Reference in New Issue
Block a user