37 lines
780 B
C
37 lines
780 B
C
|
|
// Copyright (C) 2019 Nomango
|
|||
|
|
|
|||
|
|
#pragma once
|
|||
|
|
#include "common.h"
|
|||
|
|
|
|||
|
|
class Demo1
|
|||
|
|
: public Scene
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
static ScenePtr Create()
|
|||
|
|
{
|
|||
|
|
return new Demo1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Demo1()
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
|||
|
|
auto text = E_NEW Text(L"Hello Easy2D!");
|
|||
|
|
// <20><><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>
|
|||
|
|
text->SetPosition(WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2);
|
|||
|
|
text->SetAnchor(0.5, 0.5);
|
|||
|
|
// <20><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
this->AddChild(text);
|
|||
|
|
|
|||
|
|
// ִ<>ж<EFBFBD><D0B6><EFBFBD>
|
|||
|
|
text->AddAction(
|
|||
|
|
Tween::Spawn({ // Action5: ͬʱִ<CAB1><D6B4> Action1 <20><> Action4, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
|
|||
|
|
Tween::RotateBy(60).SetDuration(1000), // Action1: 1<><31><EFBFBD><EFBFBD>ת 60 <20><>
|
|||
|
|
Tween::Sequence({ // Action4: ˳<><CBB3>ִ<EFBFBD><D6B4> Action2 <20><> Action3
|
|||
|
|
Tween::FadeOut(500), // Action2: 500<30><30><EFBFBD>뵭<EFBFBD><EBB5AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Tween::FadeIn(500) // Action3: 500<30><30><EFBFBD>뵭<EFBFBD>붯<EFBFBD><EBB6AF>
|
|||
|
|
})
|
|||
|
|
}).SetLoopCount(-1)
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
};
|