aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/ButtonSubScene.cpp
blob: 168b38742d6b0c0c7c611b8016c5c2e221daff3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "ButtonSubScene.h"
#include "ButtonScript.h"

#include <crepe/api/BehaviorScript.h>
#include <crepe/api/Sprite.h>
#include <crepe/api/Scene.h>
#include <crepe/api/Button.h>

using namespace crepe;
using namespace std;

void ButtonSubScene::create(Scene & scn){
	GameObject button_object = scn.new_object("button");
	button_object.add_component<Button>(vec2{100,100},vec2{0,0});
	button_object.add_component<Sprite>(Asset("asset/coin/coin_64.png"),Sprite::Data{
	.size = vec2{100,100},
	});
	button_object.add_component<BehaviorScript>().set_script<ButtonScript>();
}