示例#1
0
        public App(HTMLCanvasElement screen)
        {
            this.canvasScreen = screen;
            ctx = screen.GetContext(CanvasTypes.CanvasContext2DType.CanvasRenderingContext2D);
            ctx.ImageSmoothingEnabled = true;

            bgImage = new HTMLImageElement()
            {
                Src = "img/bg.png"
            };
            toad = new HTMLImageElement()
            {
                Src = "img/toad.png"
            };

            screen.AddEventListener(EventType.Click, Clicked);
            panelViewModel.FocusBestPosition();
        }
示例#2
0
        public App(HTMLCanvasElement screen)
        {
            this.canvasScreen = screen;
            ctx = screen.GetContext(CanvasTypes.CanvasContext2DType.CanvasRenderingContext2D);
            ctx.ImageSmoothingEnabled = true;
            LastMousePos             = new Vec2i();
            LastPinchGestureDistance = 0.0;

            Window.AddEventListener(EventType.Resize, OnSizeChanged);
            screen.AddEventListener(EventType.Wheel, OnMouseWheel);
            screen.AddEventListener(EventType.MouseDown, OnMouseDown);
            screen.AddEventListener(EventType.MouseUp, OnMouseUp);
            screen.AddEventListener(EventType.MouseMove, OnMouseMove);
            screen.AddEventListener(EventType.TouchStart, OnTouchStart);
            screen.AddEventListener(EventType.TouchEnd, OnTouchEnd);
            screen.AddEventListener(EventType.TouchMove, OnTouchMove);

            ReadLayerInfos();
        }