Starling Feathers Controls ScreenNavigator

2023-10-12 00:50

本文主要是介绍Starling Feathers Controls ScreenNavigator,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

说明:

The ScreenNavigator class offers a powerful system for displaying screens or menus in your application and navigating between them. It supports navigation based on events (or as3-signals, if you prefer), and it can inject properties into screens as they are shown.


示例:

var navigator:ScreenNavigator = new ScreenNavigator();navigator.addScreen( "start", new ScreenNavigatorItem( MenuScreen) );navigator.addScreen( "options", new ScreenNavigatorItem( OptionsScreen) );this.addChild( navigator );navigator.showScreen( "start" );navigator.addEventListener("showOptions",showOptions);function showOptions(e:Event):void{navigator.showScreen("options");}

MenuScreen代码:

package lft.fctest
{import feathers.controls.Button;import feathers.controls.Screen;import starling.events.Event;/*** Author:大飞狼* <br>Date: 2014-9-12 下午3:30:30* <br>Synopsis:*/public class MenuScreen extends Screen{public function MenuScreen(){super();}override protected function initialize():void{var button:Button=new Button();button.label="点击切换到options";addChild(button);button.addEventListener(Event.TRIGGERED,buttonTriggered);}private function buttonTriggered(e:Event):void{dispatchEventWith("showOptions",true);}}
}

OptionsScreen代码

package lft.fctest
{import feathers.controls.PanelScreen;/*** Author:大飞狼* <br>Date: 2014-9-11 下午3:53:42* <br>Synopsis:*/public class OptionsScreen extends PanelScreen{public function OptionsScreen(){super();}override protected function initialize():void{super.initialize();this.headerProperties.title = "Options";}}
}


效果:



更多说明参考:

http://wiki.starling-framework.org/feathers/screen-navigator

这篇关于Starling Feathers Controls ScreenNavigator的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/192072

相关文章

starling学习资料

http://gamua.com/starling/    官网 http://www.starlinglib.com/wiki/  中文资料

Automatic Educational Question Generation with Difficulty Level Controls

文章目录 题目摘要简介相关工作问题表述实验用户研究结论 题目 具有难度级别控制的自动教育问题生成 论文地址:https://link.springer.com/chapter/10.1007/978-3-031-36272-9_39 摘要     我们考虑自动生成各种难度的数学应用题 (MWP),以满足教师在相应教育阶段教学和测试学生的需求。现有方法无法生成高质

MessageDialog 是 Qt Quick Controls 中的一个组件,用于显示消息对话框

MessageDialog 是 Qt Quick Controls 中的一个组件,用于显示消息对话框。它提供了一个简单的方法来提示用户并获取他们的响应。下面是 MessageDialog 的详解,包括用法和常见属性。 1. 基本用法 import QtQuick 2.15import QtQuick.Controls 2.15ApplicationWindow {visible: truew

QML官方系列教程——Qt Quick Controls Styles

附网址:http://qt-project.org/doc/qt-5/qtquickcontrolsstyles-index.html Qt Quick Controls Styles —— Qt Quick控件样式 Qt Quick Controls Styles子模块允许为Qt Quick Controls设置自定义的样式。 它在Qt 5.1中被引入因此需要Qt Quick 2.1

QML官方系列教程——Qt Quick Controls Overview

附网址:http://qt-project.org/doc/qt-5/qtquickcontrols-overview.html Qt Quick Controls Overview —— Qt Quick Controls概述 Qt Quick Controls提供了一套用来在Qt Quick中创建用户界面的UI控件。 Getting Started —— 开始 在你的.q

ROS学习笔记(七)::RVIZ::Interactive Markers: Basic Controls

1.Interactive Markers: Basic Controls基本控件 说明:这篇教程说明base_controls教程代码如何工作 2.basic_controls教程说明: 本教程介绍你在设计交互标志物时最常用的选项。节点将从RViz得到的所有反馈打印到命令行上。  所有交互标志物包含一个灰色盒子。在大多数情况下,这个灰色盒子会与对照的其余控件一起移动。

使用摇杆Easy Touch 4 Touchscreen Virtual Controls v4.1.0 实现角色移动

这里是一个超简单的使用记录,这里给两个更加详细的介绍链接 http://blog.csdn.net/xueyedie1234/article/details/51303494 http://www.tuicool.com/articles/QJZZjy 下载easy touch的资源包么,随便找个免费的地方下,导入项目中。 然后就可以在Inspector中创建

starling性能优化总结

在项目开发的过程中总结了一下starling的性能优化方案: 1.     不要频繁的读取显示对象的宽高:调用宽高属性时会调用显示对象的getBounds()方法,该方法会遍历该对象的所有子对象,重新计算宽高。在频繁使用宽高属性时,如没有特殊需要,最好把宽高保存到变量中,使用变量保存的值替代直接读取宽高属性。 2.     扁平化的Sprites:starling在每一帧都会遍历所有对象检查它们

eclipse查看类源码出现failed to create the part's controls的解决方法

中文版出现此问题打开eclipse.ini切换为英文-Duser.language=en

Pro .NET 2.0 Windows Forms and Custom Controls in C#

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。 http://blog.csdn.net/topmvp - topmvp By using C# and the final beta of NET 2.0, this book covers Windows Forms and GDI+ namespaces thoroughl