public void Initialize(object source, NUIApplicationInitEventArgs e)
{
Log("Initialize() is called!");
- Stage stage = Stage.GetCurrent();
- stage.BackgroundColor = Color.White;
- stage.Touch += OnStageTouched;
- stage.Touch += OnStageTouched2;
- stage.Wheel += OnStageWheelEvent;
+ Window window = Window.Instance;
+ window.BackgroundColor = Color.White;
+ window.Touched += OnWindowTouched;
+ window.Touched += OnWindowTouched2;
+ window.WheelRolled += OnWindowWheelEvent;
- // Add a _text label to the stage
+ // Add a _text label to the window
_text = new TextLabel("Hello Mono World");
_text.ParentOrigin = ParentOrigin.BottomCenter;
- _text.AnchorPoint = AnchorPoint.BottomCenter;
+ _text.PivotPoint = AnchorPoint.BottomCenter;
_text.HorizontalAlignment = "CENTER";
_text.PointSize = 32.0f;
- stage.Add(_text);
+ window.Add(_text);
_view1 = new View();
_view1.Size = new Vector3(200.0f, 200.0f, 0.0f);
_view1.BackgroundColor = Color.Green;
_view1.ParentOrigin = ParentOrigin.Center;
- _view1.AnchorPoint = AnchorPoint.Center;
- _view1.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
- _view1.OnStageEvent += OnStage;
- stage.Add(_view1);
+ _view1.PivotPoint = AnchorPoint.Center;
+ _view1.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.AllDimensions);
+ _view1.AddedToWindow += OnWindow;
+ window.Add(_view1);
_view2 = new View();
_view2.BackgroundColor = Color.Red;
_view2.Size = new Vector3(50.0f, 50.0f, 0.0f);
_view2.ParentOrigin = ParentOrigin.TopLeft;
- _view2.AnchorPoint = AnchorPoint.TopLeft;
- _view2.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
+ _view2.PivotPoint = AnchorPoint.TopLeft;
+ _view2.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.AllDimensions);
_view1.Add(_view2);
_view3 = new View();
_view3.BackgroundColor = Color.Blue;
_view3.Size = new Vector3(50.0f, 50.0f, 0.0f);
_view3.ParentOrigin = ParentOrigin.TopLeft;
- _view3.AnchorPoint = AnchorPoint.TopLeft;
- _view3.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.ALL_DIMENSIONS);
+ _view3.PivotPoint = AnchorPoint.TopLeft;
+ _view3.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.AllDimensions);
_view1.Add(_view3);
_user_alpha_func = new UserAlphaFunctionDelegate(body);
_animation.Play();
}
- // Callback for stage touched signal handling
- public void OnStageTouched(object source, Stage.TouchEventArgs e)
+ // Callback for window touched signal handling
+ public void OnWindowTouched(object source, Window.TouchEventArgs e)
{
// Only animate the _text label when touch down happens
if (e.Touch.GetState(0) == PointStateType.DOWN)
{
- Log("OnStageTouched() is called! PointStateType.DOWN came!");
+ Log("OnWindowTouched() is called! PointStateType.DOWN came!");
myCount++;
if (myCount > 1)
{
}
}
- // Callback for stage touched signal handling
- public void OnStageTouched2(object source, Stage.TouchEventArgs e)
+ // Callback for window touched signal handling
+ public void OnWindowTouched2(object source, Window.TouchEventArgs e)
{
- Log("OnStageTouched2() is called!state=" + e.Touch.GetState(0));
+ Log("OnWindowTouched2() is called!state=" + e.Touch.GetState(0));
}
public void OnEventProcessingFinished(object source)
Log("OnEventProcessingFinished() is called!");
}
- public void OnStageWheelEvent(object source, Stage.WheelEventArgs e)
+ public void OnWindowWheelEvent(object source, Window.WheelEventArgs e)
{
- Log("OnStageWheelEvent() is called!");
+ Log("OnWindowWheelEvent() is called!");
}
- public void OnStage(object source, View.OnStageEventArgs e)
+ public void OnWindow(object source, View.OnWindowEventArgs e)
{
- Log("OnStage() is called!");
+ Log("OnWindow() is called!");
}
public void MainLoop()