[editor] tanks colors

This commit is contained in:
2019-03-25 21:17:39 +03:00
parent 5b804c6902
commit a948dfbaad
14 changed files with 60 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
package ru.m.tankz.render;
import haxework.view.utils.BitmapUtil;
import flash.display.Bitmap;
import flash.display.DisplayObject;
import flash.display.Shape;
@@ -253,6 +254,14 @@ class EagleItem extends BitmapItem<Eagle> {
var suffix = value.death ? '-death' : value.protect.active ? '-protected' : '';
return 'resources/image/eagle/eagle${suffix}.png';
}
override public function redraw():Void {
var image = Assets.getBitmapData(getImage());
if (!value.color.zero) {
image = BitmapUtil.colorize(image, value.color);
}
view.bitmapData = image;
}
}

View File

@@ -1,7 +1,6 @@
package ru.m.tankz.view;
import haxework.view.frame.FrameSwitcher;
import haxework.view.ButtonView;
import haxework.view.VGroupView;
@:template class SettingsFrame extends VGroupView {
@@ -10,9 +9,7 @@ import haxework.view.VGroupView;
@:provide var frameSwitcher:FrameSwitcher;
@:view var close:ButtonView;
public function onPress(_):Void {
public function close():Void {
frameSwitcher.change(StartFrame.ID);
}
}

View File

@@ -19,4 +19,4 @@ views:
- id: close
$type: haxework.view.ButtonView
skinId: button.close
+onPress: $this:onPress
+onPress: $code:close()