# HG changeset patch # User koda # Date 1329117539 -3600 # Node ID bf3cf6e60673ef828833ebf8cff3632682079f23 # Parent f46b1a1de2ce673180d4fd32848db8b199d9ad07 update position of on screen buttons on resize diff -r f46b1a1de2ce -r bf3cf6e60673 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Sun Feb 12 15:11:47 2012 -0500 +++ b/hedgewars/hwengine.pas Mon Feb 13 08:18:59 2012 +0100 @@ -268,6 +268,7 @@ WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight)); ScriptOnScreenResize(); InitCameraBorders(); + InitTouchInterface(); end; if isTerminated = false then diff -r f46b1a1de2ce -r bf3cf6e60673 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sun Feb 12 15:11:47 2012 -0500 +++ b/hedgewars/uWorld.pas Mon Feb 13 08:18:59 2012 +0100 @@ -35,6 +35,7 @@ procedure HideMission; procedure ShakeCamera(amount: LongInt); procedure InitCameraBorders; +procedure InitTouchInterface; procedure MoveCamera; procedure onFocusStateChanged; @@ -197,6 +198,16 @@ SkyOffset:= 0; HorizontOffset:= 0; +InitTouchInterface(); +end; + +procedure InitCameraBorders; +begin +cGearScrEdgesDist:= min(2 * cScreenHeight div 5, 2 * cScreenWidth div 5); +end; + +procedure InitTouchInterface; +begin {$IFDEF USE_TOUCH_INTERFACE} //positioning of the buttons buttonScale:= 1.5/cDefaultZoomLevel; @@ -234,16 +245,9 @@ arrowDownY:= -Round(spritesData[sprArrowDown].Texture^.h*buttonscale) + cScreenHeight; arrowDownW:= Round(spritesData[sprArrowDown].Texture^.w * buttonScale); arrowDownH:= Round(spritesData[sprArrowDown].Texture^.h * buttonScale); - - {$ENDIF} end; -procedure InitCameraBorders; -begin -cGearScrEdgesDist:= min(2 * cScreenHeight div 5, 2 * cScreenWidth div 5); -end; - // for uStore texture resetting procedure ResetWorldTex; begin