-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWordBox.hx
More file actions
35 lines (30 loc) · 1 KB
/
WordBox.hx
File metadata and controls
35 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import GameScene.GameController;
import h2d.Scene;
class WordBox extends h2d.Interactive{
var asset:hxd.res.Image;
public var ogX = 0;
public var ogY = 0;
public function CreateBox(letter:String, rendertarget:Scene, xPos:Int, yPos:Int ){
asset = hxd.Res.ast.TextBox;
var assetdata = asset.toTile();
var assetbmp = new h2d.Bitmap(assetdata,this);
var tf = new h2d.Text(GameController.NewFont, this);
tf.text = letter.toUpperCase();
tf.x = 10;
tf.y = 0;
tf.scale(1.75);
tf.color = new h3d.Vector4(0,0,0,1);
this.x = xPos;
this.y = yPos;
ogX = xPos;
ogY = yPos;
}
public function CreateItemBox(ItemToPreview:Item.Item, rendertarget:Scene, xPos:Int, yPos:Int ){
asset = hxd.Res.ast.ItemSelect;
var assetdata = asset.toTile();
var assetbmp = new h2d.Bitmap(assetdata,this);
ItemToPreview.DrawIcon(assetbmp);
this.x = xPos;
this.y = yPos;
}
}