From 340de859d14254388105cb596072f3b9846b6ee4 Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Tue, 1 Feb 2011 08:39:39 -0800 Subject: [PATCH] add "zoom to 100%" button --- assets/zoom.png | Bin 0 -> 692 bytes src/WorldStage.as | 12 ++++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 assets/zoom.png diff --git a/assets/zoom.png b/assets/zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..908612e394525fc2e52a7e9b94689c25ce167381 GIT binary patch literal 692 zcmV;l0!#ggP)m+BBgry{~j2fHLegbHP( zrgXNbr0}2;^nywdjLjZe?uxtrd3D(pZH@fFFc0{BW_~jxoO1w7-VX;6vK@ROA$$R6 zEmo;Ht-Mj|>5jUy{bQ^V5@53LRI8AgLpUm|m+15sqcz@QtVSo|oz7ArM8?pIn+>gN z0b=4_b5O|4A*;Q+vc9Vqr~%3V155*NV~@gTz}KSUiKB-uJzjMZ>5%Q#n24H!V{ zTY(LLAE*NAHZ}C#wnj%Bw5OFIkRhkkAW#kDC3j9Wm0YXRaXlyyp>#mVfYG)eC;@ab zDb=T-BCAY4LI(Z@GOTr2V_A{pRwSmz+8Be>CjAw(=gnbVWAeguvZa93JmL(EDxv1m z0OP4q=fpAK1Mq!C2`OkEn37o;m#wF#(t(8Pu#S?2f#x<~4EO{@fmm`p9veD6RZ_jp z@Au4};q&`XuKEYgIiB4((kgxOs#YdqJw0fY>9^K_agEu5+$#k;w#%I2N>n_?)YIqu z`tq&#_^p?-%K*U0^}|7+9U(&k0?s;=r=uCZ%)H9_edH8wK}gB(nUB1FFk+2Ol%BXV zHoFY`D~2x|2(); - var sidebarSave: Sidebar = AddSidebar(new Sidebar(FP.width - 32, FP.width, 0, 0, 32, 32, LAYER_SAVE, false, false)); + var sidebarSave: Sidebar = AddSidebar(new Sidebar(FP.width - 32, FP.width, FP.height - 64, FP.height - 64, 32, 64, LAYER_SAVE, false, false)); new Button(sidebarSave, bmpSave, Save); + new Button(sidebarSave, bmpZoom, ResetZoom); sidebarMsg = null; alarmMsg = null; @@ -244,7 +247,12 @@ package alarmMsg = Alarm(addTween(new Alarm(2, function():void { sidebarMsg.Toggle(ShowNextMsg); }, Tween.ONESHOT), true)); } } - + private function ResetZoom(): void + { + var pointMiddle: Point = new Point(FP.halfWidth, FP.halfHeight); + pointView = PointRealFromScreen(pointMiddle).subtract(pointMiddle); + zoom = 1; + } public function Save(): void { var stream: FileStream = new FileStream();