Skip to content

Commit

Permalink
components-explorer: use AssetLoader for button icon and set sourceScale
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Jan 28, 2025
1 parent ff16e94 commit ef56f08
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.feathersui.components.views;

import feathers.controls.AssetLoader;
import feathers.controls.Button;
import feathers.controls.Header;
import feathers.controls.Panel;
Expand Down Expand Up @@ -31,9 +32,11 @@ class ButtonScreen extends Panel {
this.button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
this.addChild(this.button);

var icon = new AssetLoader("favicon");
icon.sourceScale = 0.5;
this.iconButton = new Button();
this.iconButton.text = "Button with Icon";
this.iconButton.icon = new Bitmap(Assets.getBitmapData("favicon"));
this.iconButton.icon = icon;
this.addChild(this.iconButton);

this.toggleButton = new ToggleButton();
Expand Down

0 comments on commit ef56f08

Please sign in to comment.