Difference between revisions of "Image.flip"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>Image.flip</c> sets the image to be drawn either flipped vertically or horizontally. === Arguments === {| class="wikitable" |- ! Parameter Name !! Type !! Default Val...")
 
Line 1: Line 1:
<c>[[Image]].flip</c> sets the image to be drawn either flipped vertically or horizontally.
+
<c>[[Image]].flip</c> flips an image in memory, either vertically or horizontally.
  
 
=== Arguments ===
 
=== Arguments ===
Line 7: Line 7:
 
! Parameter Name !! Type !! Default Value !! Meaning
 
! Parameter Name !! Type !! Default Value !! Meaning
 
|-
 
|-
| ''direction'' || boolean || true || flips the image horizontally when true and vertically when false  
+
| ''vertical'' || boolean || false || flips the image vertically when true and horizontally when false  
 
|}  
 
|}  
  
Line 13: Line 13:
  
 
<ms>img = file.loadImage("/sys/pics/Wumpus.png")
 
<ms>img = file.loadImage("/sys/pics/Wumpus.png")
img.flip(true)</ms>
+
img.flip false
 +
view img</ms>
 +
 
 +
After running the above code, `img` refers to a horizontally-flipped version of the standard Wumpus image.
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]
 
[[Category:Soda]]
 
[[Category:Soda]]

Revision as of 14:19, 18 January 2025

Image.flip flips an image in memory, either vertically or horizontally.

Arguments

Parameter Name Type Default Value Meaning
vertical boolean false flips the image vertically when true and horizontally when false

Example

img = file.loadImage("/sys/pics/Wumpus.png")
img.flip false
view img

After running the above code, `img` refers to a horizontally-flipped version of the standard Wumpus image.