本文整理汇总了C#中Engine.Button类的典型用法代码示例。如果您正苦于以下问题:C# Button类的具体用法?C# Button怎么用?C# Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Button类属于Engine命名空间,在下文中一共展示了Button类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OKButton_Click
private void OKButton_Click(Button sender)
{
if (clickHandler != null)
clickHandler(sender);
SetShouldDetach();
}
示例2: InitializeMenu
private void InitializeMenu()
{
menuFont = new Font(textureManager.Get("menu_font"), FontParser.Parse("menuFont.fnt"));
menu = new VerticalMenu(0, -100, input, new Color(1, 1, 1, 1), new Color(0, 0, 1, 1));
// Create start, controls, exit for menu
Button start = new Button(delegate(object sender, EventArgs e)
{
stateSystem.ChangeState("inner_game");
ResetGameData();
},
new Text("Start", menuFont));
Button controls = new Button(delegate(object sender, EventArgs e)
{
stateSystem.ChangeState("controls");
},
new Text("Controls", menuFont));
Button exit = new Button(delegate(object sender, EventArgs e)
{
System.Windows.Forms.Application.Exit();
},
new Text("Exit", menuFont));
menu.AddButton(start);
menu.AddButton(controls);
menu.AddButton(exit);
}
示例3: Init
internal bool Init()
{
//buttons
Button[] buttons = new Button[ 2 ];
buttons[ 0 ] = new Button( JoystickButtons.Button1, 0 );
buttons[ 1 ] = new Button( JoystickButtons.Button2, 1 );
//axes
Axis[] axes = new Axis[ 1 ];
axes[ 0 ] = new JoystickInputDevice.Axis( JoystickAxes.X, new Range( -1, 1 ), false );
//povs
POV[] povs = new POV[ 0 ];
//povs[ 0 ] = new JoystickInputDevice.POV( JoystickPOVs.POV1 );
//sliders
Slider[] sliders = new Slider[ 0 ];
//sliders[ 0 ] = new Slider( JoystickSliders.Slider1 );
//forceFeedbackController
ForceFeedbackController forceFeedbackController = null;
//initialize data
InitDeviceData( buttons, axes, povs, sliders, forceFeedbackController );
return true;
}
示例4: MessageBoxWindow
//
public MessageBoxWindow(string messageText, string caption, string windowname, Button.ClickDelegate clickHandler)
{
this.messageText = messageText;
this.caption = caption;
this.Name = this.windowname = windowname;
this.clickHandler = clickHandler;
}
示例5: InitializeMenu
private void InitializeMenu()
{
_menu = new VerticalMenu(0, 150, _input);
Color focusColor = new Color(251, 242, 0, 1);
Color noFocusColor = new Color(0.14f, 0.57f, 0.14f, 1);
Button startGame = new Button(
delegate(object o, EventArgs e)
{
_system.ChangeState("start_state");
},
new Text("Back To Start", _generalFont), focusColor, noFocusColor);
Button exitGame = new Button(
delegate(object o, EventArgs e)
{
// Quit
System.Windows.Forms.Application.Exit();
},
new Text("Quit", _generalFont), focusColor, noFocusColor);
_menu.AddButton(startGame);
_menu.AddButton(exitGame);
}
示例6: InitializeMenu
private void InitializeMenu()
{
_menu = new VerticalMenu(0, 150, _input);
Button startGame = new Button(delegate(object o, EventArgs e) { _system.ChangeState("inner_game"); }, new Text("Start", _generalFont));
Button gameSettings = new Button(delegate(object o, EventArgs e) { /*Go to settings */ }, new Text("Settings", _generalFont));
Button exitGame = new Button(delegate(object o, EventArgs e) { /*Quit*/ System.Windows.Forms.Application.Exit(); }, new Text("Exit", _generalFont));
_menu.AddButton(startGame);
_menu.AddButton(gameSettings);
_menu.AddButton(exitGame);
}
示例7: Create
public override void Create()
{
base.Create();
GameObject cursorA = new Cursor(new XboxController(SlimDX.XInput.UserIndex.One));
GameObject cursorB = new Cursor(new XboxController(SlimDX.XInput.UserIndex.Two));
ObjectManager.AddGameObject(cursorA);
ObjectManager.AddGameObject(cursorB);
GameObject start = new Button(512, 256, "startbutton.png", Button.StateSwitch.NORMAL_MODE);
ObjectManager.AddGameObject(start);
}
示例8: InitializeMenu
private void InitializeMenu()
{
_menu = new VerticalMenu(0, 150, _input);
var startGame = new Button(delegate { _system.ChangeState("inner_game"); }, new Text("Start", _generalFont));
var gameSettings = new Button(delegate
{
/* Go To Settings */
}, new Text("Settings", _generalFont));
var exitGame = new Button(delegate { Application.Exit(); }, new Text("Exit", _generalFont));
_menu.AddButton(startGame);
_menu.AddButton(gameSettings);
_menu.AddButton(exitGame);
}
示例9: OnAttach
///////////////////////////////////////////
protected override void OnAttach()
{
base.OnAttach();
//disable check for disconnection
GameEngineApp.Instance.Client_AllowCheckForDisconnection = false;
//register config fields
EngineApp.Instance.Config.RegisterClassParameters( GetType() );
//create window
window = ControlDeclarationManager.Instance.CreateControl(
"Gui\\MultiplayerLoginWindow.gui" );
Controls.Add( window );
MouseCover = true;
BackColor = new ColorValue( 0, 0, 0, .5f );
//initialize controls
buttonCreateServer = (Button)window.Controls[ "CreateServer" ];
buttonCreateServer.Click += CreateServer_Click;
buttonConnect = (Button)window.Controls[ "Connect" ];
buttonConnect.Click += Connect_Click;
( (Button)window.Controls[ "Exit" ] ).Click += Exit_Click;
//generate user name
if( string.IsNullOrEmpty( userName ) )
{
EngineRandom random = new EngineRandom();
userName = "Player" + random.Next( 1000 ).ToString( "D03" );
}
editBoxUserName = (EditBox)window.Controls[ "UserName" ];
editBoxUserName.Text = userName;
editBoxUserName.TextChange += editBoxUserName_TextChange;
editBoxConnectTo = (EditBox)window.Controls[ "ConnectTo" ];
editBoxConnectTo.Text = connectToAddress;
editBoxConnectTo.TextChange += editBoxConnectTo_TextChange;
SetInfo( "", false );
}
示例10: InitializeMenu
private void InitializeMenu()
{
_menu = new VerticalMenu(0, 150, _input);
Button startGame = new Button(
delegate(object o, EventArgs e)
{
_system.ChangeState("inner_game");
},
new Text("Start", _generalFont));
Button exitGame = new Button(
delegate(object o, EventArgs e)
{
// Quit
System.Windows.Forms.Application.Exit();
},
new Text("Exit", _generalFont));
Button helpPage = new Button(
delegate(object o, EventArgs e){
//change state to help page
_system.ChangeState("help_state");
},
new Text("Game Help", _generalFont));
Button kabajie = new Button(
delegate(object o, EventArgs e)
{
//change state to help page
_system.ChangeState("kabajie");
},
new Text("Kabaji Egara", _generalFont));
_menu.AddButton(startGame);
_menu.AddButton(exitGame);
_menu.AddButton(helpPage);
_menu.AddButton(kabajie);
}
示例11: GuiTest_Click
void GuiTest_Click( Button sender )
{
GameEngineApp.Instance.ControlManager.Controls.Add( new GuiTestWindow() );
}
示例12: Exit_Click
void Exit_Click( Button sender )
{
GameEngineApp.Instance.SetFadeOutScreenAndExit();
}
示例13: EffectDestroy_Click
void EffectDestroy_Click( Button sender )
{
ForceFeedbackEffect effect = GetSelectedEffect();
if( effect != null )
effect.Destroy();
}
示例14: textureListButton_Click
void textureListButton_Click( Button sender )
{
Texture[] textures = TextureManager.Instance.GetAllTextures();
ArrayUtils.SelectionSort( textures, delegate( Texture texture1, Texture texture2 )
{
return string.Compare( texture1.Name, texture2.Name );
} );
Log.Info( "List of textures in the memory:" );
foreach( Texture texture in textures )
Log.Info( "{0}, {1}x{2}, {3}", texture.Name, texture.Size.X, texture.Size.Y, texture.Format );
Log.Info( "TOTAL: {0}", textures.Length );
if( EngineConsole.Instance != null )
{
EngineConsole.Instance.Active = true;
EngineConsole.Instance.ScrollDown();
}
}
示例15: Run_Click
void Run_Click( Button sender )
{
GameEngineApp.Instance.SetNeedMapLoad( "Maps\\MainDemo\\Map.map" );
}