My Project
 
Loading...
Searching...
No Matches
shadowbox.h
Go to the documentation of this file.
1#pragma once
2
3#include "ninepatch.h"
4#include "define.h"
5#include "util.h"
6
7class ShadowBox :public NinePatch{
8public:
9 static const int SIZE = 16;
10
11 ShadowBox() :NinePatch(Assets::SHADOW, 1)
12 {
13 texture->filter(SmartTexture::LINEAR, SmartTexture::LINEAR);
14
15 GameMath::PointFSet(&scale, SIZE, SIZE);
16 //scale.set(SIZE, SIZE);
17 }
18
19 virtual void size(float width, float height)
20 {
21 NinePatch::size(width / SIZE, height / SIZE);
22 }
23
24 void boxRect(float x, float y, float width, float height)
25 {
26 this->x = x - SIZE;
27 this->y = y - SIZE;
28 size(width + SIZE * 2, height + SIZE * 2);
29 }
30};
Definition define.h:18
ShadowBox()
Definition shadowbox.h:11
virtual void size(float width, float height)
Definition shadowbox.h:19
void boxRect(float x, float y, float width, float height)
Definition shadowbox.h:24
static const int SIZE
Definition shadowbox.h:9