浏览代码

40_Localization: Center mouse on start

1vanK 8 年之前
父节点
当前提交
fa767d1dc1

+ 4 - 2
Source/Samples/40_Localization/L10n.cpp

@@ -51,8 +51,10 @@ void L10n::Start()
     // Execute base class startup
     Sample::Start();
 
-    // Enable OS cursor
-    GetSubsystem<Input>()->SetMouseVisible(true);
+    // Enable and center OS cursor
+    Input* input = GetSubsystem<Input>();
+    input->SetMouseVisible(true);
+    input->CenterMousePosition();
 
     // Load strings from JSON files and subscribe to the change language event
     InitLocalizationSystem();

+ 2 - 1
bin/Data/LuaScripts/40_Localization.lua

@@ -10,8 +10,9 @@ function Start()
     -- Execute the common startup for samples
     SampleStart()
 
-    -- Enable OS cursor
+    -- Enable and center OS cursor
     input.mouseVisible = true
+    input:CenterMousePosition()
 
     -- Load strings from JSON files and subscribe to the change language event
     InitLocalizationSystem()

+ 2 - 1
bin/Data/Scripts/40_Localization.as

@@ -11,8 +11,9 @@ void Start()
     // Execute the common startup for samples
     SampleStart();
 
-    // Enable OS cursor
+    // Enable and center OS cursor
     input.mouseVisible = true;
+    input.CenterMousePosition();
 
     // Load strings from JSON files and subscribe to the change language event
     InitLocalizationSystem();