| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- using BansheeEngine;
- namespace BansheeEditor
- {
- /** @addtogroup Windows
- * @{
- */
- /// <summary>
- /// Displays animation curve editor window.
- /// </summary>
- internal class AnimationWindow : EditorWindow
- {
- private GUICanvas canvas;
- /// <summary>
- /// Opens the animation window.
- /// </summary>
- [MenuItem("Windows/Animation", ButtonModifier.CtrlAlt, ButtonCode.A, 6000)]
- private static void OpenGameWindow()
- {
- OpenWindow<AnimationWindow>();
- }
- /// <inheritdoc/>
- protected override LocString GetDisplayName()
- {
- return new LocEdString("Animation");
- }
- private void OnInitialize()
- {
- canvas = new GUICanvas(GUIOption.FixedWidth(200), GUIOption.FixedHeight(200));
- {
- Vector2I a = new Vector2I(0, 0);
- Vector2I b = new Vector2I(200, 0);
- Vector2I c = new Vector2I(200, 200);
- Vector2I d = new Vector2I(0, 200);
- canvas.DrawTriangleStrip(new Vector2I[] { b, c, a, d }, Color.BansheeOrange);
- }
- {
- Vector2I a = new Vector2I(150, 20);
- Vector2I b = new Vector2I(230, 20);
- Vector2I c = new Vector2I(150, 70);
- canvas.DrawTriangleList(new Vector2I[] {a, b, c});
- }
- GUI.AddElement(canvas);
- }
- private void OnEditorUpdate()
- {
- int position = (int)(MathEx.Sin(Time.RealElapsed)*50.0f + 50.0f);
- canvas.SetPosition(position, 0);
- }
- private void OnDestroy()
- {
- // TODO
- }
- }
- /** @} */
- }
|