This commit is contained in:
2023-04-21 23:30:33 -07:00
parent cacda495d3
commit 72a0bb9192
8 changed files with 157 additions and 38 deletions

View File

@ -9,7 +9,9 @@
#include "prefabs/SimpleSpinningCubePrefab.hpp"
#include "games/vn/components/VNManager.hpp"
#include "games/vn/events/VNDummyEvent.hpp"
#include "games/vn/events/VNTextEvent.hpp"
#include "games/vn/events/VNPositionEvent.hpp"
#include "games/vn/events/VNSetEvent.hpp"
namespace Dawn {
class HelloWorldScene : public Scene {
@ -17,6 +19,8 @@ namespace Dawn {
Camera *camera;
UICanvas *canvas;
int32_t test = 0;
void stage() override {
canvas = UICanvas::create(this);
@ -32,14 +36,21 @@ namespace Dawn {
auto eventTest = vnManager->createEvent<VNDummyEvent>();
auto positionEvent = vnManager->createEvent<VNPositionEvent>();
positionEvent->x = 2.0f;
positionEvent->to.x = 2.0f;
positionEvent->item = cube;
positionEvent->duration = 3.0f;
auto vnTextEvent = vnManager->createEvent<VNTextEvent>();
vnTextEvent->text = "Hello World!";
auto setPropertyEvent = vnManager->createEvent<VNSetEvent<int32_t>>();
setPropertyEvent->modifies = &test;
setPropertyEvent->to = 10;
eventTest
->then(positionEvent)
->then(vnManager->createEvent<VNDummyEvent>())
->then(vnManager->createEvent<VNDummyEvent>())
->then(vnTextEvent)
->then(setPropertyEvent)
;
vnManager->setEvent(eventTest);
}