burger menu try
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -31,5 +31,6 @@
|
|||||||
|
|
||||||
<!-- copies data/Employees.xml to output -->
|
<!-- copies data/Employees.xml to output -->
|
||||||
<assets path="assets/data" rename="data" embed="false"/>
|
<assets path="assets/data" rename="data" embed="false"/>
|
||||||
|
<assets path="assets/bitmaps" rename="bitmaps" embed="false"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package components;
|
||||||
|
|
||||||
|
import openfl.display.Bitmap;
|
||||||
|
import openfl.display.BitmapData;
|
||||||
|
import feathers.controls.Button;
|
||||||
|
import t9.util.ColorTraces.*;
|
||||||
|
|
||||||
|
class NekoIconButton extends Button{
|
||||||
|
|
||||||
|
private var bmp:Bitmap;
|
||||||
|
|
||||||
|
public function new(pSkin:BitmapData, pX:Int = 0, pY:Int = 0, pWidth:Int = 100, pHeight:Int = 100) {
|
||||||
|
|
||||||
|
super();
|
||||||
|
|
||||||
|
bmp = new Bitmap(pSkin);
|
||||||
|
backgroundSkin = bmp;
|
||||||
|
bmp.width = pWidth;
|
||||||
|
bmp.height = pHeight;
|
||||||
|
bmp.smoothing = true;
|
||||||
|
traceYellow(pWidth + " / " + pHeight);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import components.NekoIconButton;
|
||||||
|
import openfl.display.Bitmap;
|
||||||
import feathers.events.TriggerEvent;
|
import feathers.events.TriggerEvent;
|
||||||
import feathers.controls.Button;
|
import feathers.controls.Button;
|
||||||
import feathers.layout.HorizontalLayout;
|
import feathers.layout.HorizontalLayout;
|
||||||
@@ -20,7 +22,7 @@ import t9.util.ColorTraces.*;
|
|||||||
class MainHeader extends LayoutGroup {
|
class MainHeader extends LayoutGroup {
|
||||||
|
|
||||||
private var lb1:Label;
|
private var lb1:Label;
|
||||||
private var dBtn:Button;
|
private var drawerBtn:NekoIconButton;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
@@ -51,9 +53,9 @@ class MainHeader extends LayoutGroup {
|
|||||||
layout = l;
|
layout = l;
|
||||||
|
|
||||||
// Drawer button
|
// Drawer button
|
||||||
dBtn = new Button("menu");
|
drawerBtn = new NekoIconButton(Assets.getBitmapData("bitmaps/menu_white.png"), 0, 0, Std.int(headerHeight), Std.int(headerHeight));
|
||||||
dBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
drawerBtn.addEventListener(TriggerEvent.TRIGGER, onDBtnPress);
|
||||||
addChild(dBtn);
|
addChild(drawerBtn);
|
||||||
|
|
||||||
|
|
||||||
// Title label
|
// Title label
|
||||||
@@ -66,7 +68,7 @@ class MainHeader extends LayoutGroup {
|
|||||||
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
||||||
|
|
||||||
lb1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
lb1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
||||||
addChild(lb1);
|
//addChild(lb1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
|
|||||||
Reference in New Issue
Block a user