forked from kiwiphoenix364/pxt-zoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
1 lines (1 loc) · 5.68 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="fQL7t.OdW5zfmbQ5rbnf">memsize</variable><variable id="YA$PBe6T7K[!GM@cs5.;">size1</variable><variable id="PIxBfE%yj%jUF1HDKJwF">zLayer</variable><variable id="iWa/XRHCT,q16]M-Oq_@">left</variable><variable id="e1u{!os}r/}zvkWBIYv!">top</variable></variables><block type="pxt-on-start" id="NomRiW^PuX-5Jo:cN2Er" x="0" y="0"><statement name="HANDLER"><block type="typescript_statement" id=")~9%56HUTM{~F?$r7Q0V" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let y1 = 0" numlines="1" declaredvars="y1"></mutation><next><block type="typescript_statement" id="S},Kr3Px|+U4?4fZrV/j" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let x1 = 0" numlines="1" declaredvars="x1"></mutation><next><block type="variables_set" id="{,*0X)/$ByMD:cy*_-*-"><field name="VAR" id="fQL7t.OdW5zfmbQ5rbnf">memsize</field><value name="VALUE"><shadow type="math_number" id="y`]LFM?t{=q;yspPI{2O"><field name="NUM">1</field></shadow></value><next><block type="variables_set" id="dMi?Zp2J:3GZL=klV4cE"><field name="VAR" id="YA$PBe6T7K[!GM@cs5.;">size1</field><value name="VALUE"><shadow type="math_number" id="9EUJx{qHxUX!?E(+(P3{"><field name="NUM">1</field></shadow></value><next><block type="typescript_statement" id="HEg}I@_CfB=iP5;*Wg6{" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let buf = Buffer.create(120)" numlines="1" declaredvars="buf"></mutation><next><block type="variables_set" id="_#7o0TuvU1[`xdeeuMfU"><field name="VAR" id="PIxBfE%yj%jUF1HDKJwF">zLayer</field><value name="VALUE"><shadow type="math_number" id="R$BA7VQ9uzx}.tSU*b;!"><field name="NUM">1</field></shadow></value><next><block type="variables_set" id="VnW1kYSXw+ifjM0FZY/S"><field name="VAR" id="iWa/XRHCT,q16]M-Oq_@">left</field><value name="VALUE"><shadow type="math_number" id="NdcP1mh5bXU#IdBrV;:t"><field name="NUM">1</field></shadow></value><next><block type="variables_set" id="ECjLJVLd~.4@rX`WJ,jZ"><field name="VAR" id="e1u{!os}r/}zvkWBIYv!">top</field><value name="VALUE"><shadow type="math_number" id="cOgk-N2;J/oE.J_~wh(L"><field name="NUM">1</field></shadow></value><next><block type="typescript_statement" id="xY%RzkD(arm[TPf;O?;e" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let variable = scene.createRenderable(zLayer, (image: Image, camera: scene.Camera) => {" line1=" let screenclone = image.clone()" line2=" //helpers.imageBlit(image, (x1 - Math.trunc(x1)) * - size1, (y1 - Math.trunc(y1)) * - size1, 160 + Math.ceil(size1), 120 + Math.ceil(size1), screenclone, x1, y1, (160 - Math.ceil(size1)) / size1, (120 - Math.ceil(size1)) / size1, true, false)" line3=" helpers.imageBlit(image, x1, y1, 160 * size1, 120 * size1, screenclone, 0, 0, 159, 119, true, false)" line4="})" numlines="5" declaredvars="variable"></mutation><next><block type="typescript_statement" id="@0yA-R9vpye(d+a-b8[w" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="enum Mode {" line1=" //% block="Center"" line2=" Center," line3=" //% block="Top-Left"" line4=" TopLeft," line5=" //% block="Top"" line6=" Top," line7=" //% block="Top-Right"" line8=" TopRight," line9=" //% block="Left"" line10=" Left," line11=" //% block="Right"" line12=" Right," line13=" //% block="Bottom-Left"" line14=" BottomLeft," line15=" //% block="Bottom"" line16=" Bottom," line17=" //% block="Bottom-Right"" line18=" BottomRight" line19="}" numlines="20"></mutation><next><block type="typescript_statement" id="#BVElAS6lJ$::]1n,Jix" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="namespace Zoom {" line1=" //% block" line2=" //% picker.fieldEditor="gridpicker"" line3=" //% picker.fieldOptions.width=220" line4=" //% picker.fieldOptions.columns=1" line5=" //% picker=Mode" line6=" //% block="zoom in screen image to %size times with anchor $anchor over $ms ms"" line7=" export function SetZoomFilter(size: number, anchor: Mode, ms: number) {" line8=" memsize = size - size1" line9=" for (let i = 0; i < ms / (25); i++) {" line10=" size1 = size1 + memsize / (ms / 25)" line11=" if (anchor == 0 || anchor == 2 || anchor == 7) {" line12=" x1 = (160 - (160 / size1)) / 2" line13=" } else if (anchor == 3 || anchor == 5 || anchor == 8) {" line14=" x1 = 160 - (160 / size1)" line15=" }" line16=" if (anchor == 0 || anchor == 4 || anchor == 5) {" line17=" y1 = (120 - (120 / size1)) / 2" line18=" } else if (anchor == 6 || anchor == 7 || anchor == 8) {" line19=" y1 = 120 - (120 / size1)" line20=" }" line21=" pause(25)" line22=" }" line23=" }" line24=" //% block" line25=" //% block="zoom in screen image to %size times with offset x $x y $y over $ms ms"" line26=" export function SetZoomFilterOffset(size: number, x: number, y: number, ms: number) {" line27=" memsize = size - size1" line28=" for (let j = 0; j < ms / (25); j++) {" line29=" size1 = size1 + memsize / (ms / 25)" line30=" x1 = x + 80 - size1 * 80" line31=" y1 = y + 60 - size1 * 60" line32=" pause(25)" line33=" }" line34=" }" line35="}" numlines="36"></mutation></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>