예제 #1
0
        public override async void _Ready()
        {
            // Parent is a MarginContainer, next parent is VirtualControls
            parent      = (VirtualControls)GetParent().GetParent();
            defaultFont = SimpleDefaultFont.Regular;

            // Create background
            background = new Background();
            AddChild(background);

            // Create handle
            handle = new Handle();
            background.AddChild(handle);

            // Check for touchscreen mode
            if (parent.VisibilityMode == VisibilityModeEnum.TouchscreenOnly && !OS.HasTouchscreenUiHint())
            {
                Hide();
            }

            // Wait for next frame to store original position
            await ToSignal(GetTree(), "idle_frame");

            background.OriginalPosition = background.RectPosition;
        }
예제 #2
0
        public override void _Ready()
        {
            // Add virtual controls
            controls = new VirtualControls();
            AddChild(controls);

            spaceship = new SpaceshipWithParticles()
            {
                Position = GetViewportRect().Size / 2
            };
            AddChild(spaceship);
        }
예제 #3
0
        public override void _Ready()
        {
            // Add virtual controls
            controls = new VirtualControls();
            AddChild(controls);

            // Add car
            car = new Car()
            {
                Position = GetViewportRect().Size / 2
            };
            AddChild(car);
        }
예제 #4
0
        public override void _Ready()
        {
            // Parent is a MarginContainer, next parent is VirtualControls
            parent      = (VirtualControls)GetParent().GetParent();
            defaultFont = SimpleDefaultFont.Regular;

            // Add buttons
            buttonA = new TouchButton(ButtonALabel, ButtonAColor);
            AddChild(buttonA);
            buttonB = new TouchButton(ButtonBLabel, ButtonBColor);
            AddChild(buttonB);

            // Check for touchscreen mode
            if (parent.VisibilityMode == VisibilityModeEnum.TouchscreenOnly && !OS.HasTouchscreenUiHint())
            {
                Hide();
            }
        }
예제 #5
0
	void Start()
	{
		_controls = new VirtualControls();
		_controls.createDebugQuads();
	}
예제 #6
0
파일: DemoTwo.cs 프로젝트: shyonchow/AR_FPS
 void Start()
 {
     _controls = new VirtualControls();
     _controls.createDebugQuads();
 }
 private void Awake()
 {
     Instance = this;
 }