- DESCRIPTION
- Wrapper class for a hardware-accelerated image. Image objects don't contain the actual image data, but instead store an index that the native layer uses to identify images.
- PROPERTIES
- size : Vector2
- The nominal size of the given image, in pixels. Change 'size' if you want the image's standard size to be a given number of pixels or change 'scale' if you want the image to be proportionally larger or smaller.
- scale : Vector2
- The size multiplier for rendering, (1.0,1.0) by default. Setting "scale = Vector2(2.0,0.5)" would cause the image to render at twice the width and half the height. Change 'size' instead if you want to achieve particular pixel dimensions.
- handle : Vector2
- Specifies the drawing and rotation origin of this image. This can be set to a pixel value relative to the upper-left of the image (0,0) or a Handle category such as "Handle.center" or "Handle.bottom_center". The handle is the top-left corner (0,0) by default.
- color : Color
- The multiplier for each pixel in this image as it's drawn. The default color of Color(255,255,255,255) ensures that the image will appear "normal". A color of Color(255,255,0) would not draw any of the blue channel, making a grey-scale image appear to be tinted yellow. A color of Color(255,255,255,128) would draw the image halfway transparent.
- render_flags : Render
- blend : Blend
- Blending mode. See class BlendManager for more examples.
- angle : Radians
- The angle property variable. This may be set to a new Radians or Degrees value.
- hflip : Logical
- Specifies that an image should be flipped horizontally when drawn. This mirroring is applied before the image is rotated and does not affect the spatial positioning.
- vflip : Logical
- Specifies that an image should be flipped vertically when drawn. This mirroring is applied before the image is rotated and does not affect the spatial positioning.
- alpha : Int32
- Internal use. Prevents 'alpha' from being declared again by mistake and being intercepted by access methods.
- texture : Texture
- The index used to identify the associated image to the native layer.
- uv : Corners
- The texture (u,v) coordinates, each [0..1].
- texture_sheet_corner : Vector2
- Typically used to keep track of where this image's texture resides on its texture sheet.
- alpha_mask : Image
- Another image to take alpha values from when this image is drawn. If "null" (default), both alpha and color values are taken from this image.
- manager : TextureSheetManager
- Internal use. If non-null, is the object that manages the texture data for this image.
- METHODS
- init(String filename[,String texture_sheet_name][,Int32 pixel_format])
- Creates an image from the given png or jpeg file. Some platforms may support additional formats.
- The following variations of 'filename' are checked:
-
filename
filename.ext (.ext = [.png|.jpg|.jpeg])
data/filename
data/filename.ext
'pixel_format' is a pixel format suggestion for how the loaded image should be stored in video memory. Choices are "rgb32", "rgb16", and "indexed".
- Note: if a PNG isn't loading correctly, try running Ken Silverman's PNGOUT program on it. This is a good idea anyways as PNGOUT compression is generally better and decompresses faster than normal PNG compression.
- init(Bitmap src_bitmap[,String texture_sheet_name][,Int32 pixel_format])
- Creates an image from the given software bitmap.
- 'pixel_format' is a pixel format suggestion for how the loaded image should be stored in video memory. Choices are "rgb32", "rgb16", and "indexed".
- init(Image existing,Int32 x,Int32 y,Int32 w,Int32 h)
- init(Image existing,Vector2 top_left,Vector2 init:size)
- init(Image existing,Box box)
- clean_up()
- Internal use. Calls release().
- release()
- hash_code().Int32
- alpha_mask(Image new_alpha_mask)
- draw(Vector2 v)
- draw(Box box)
- Draws this image at the specified rectangular coordinates.
- draw(Box box,ColorGradient colors)
- Draws this image at the specified rectangular coordinates with the given corner colors.
- draw(Quad q)
- Draws this image at the specified quadrangular coordinates.
- draw(Quad q,ColorGradient colors)
- Draws this image at the specified quadrangular coordinates with the given corner colors.
- crop(Real64 pixels_to_contract)
- Contracts the edge UV texture coordinates by 'pixels_to_contract' along each edge and reduces the 'size' of this image by "2*pixels_to_contract" in each dimension.
- The existing 'size' is used to calculate how much the UV coordinates should be adjusted by.
- Does not change the 'handle', which may need to be reset.
- crop(Box bounds)
- Adjusts the UV coordinates and size of this image to match the pixel dimensions of the given 'bounds' box.
- Does not change the 'handle', which may need to be reset.
- split_into_tiles(Int32 tiles_wide,Int32 tiles_high).Image[]
- Splits this Image into a list of separate Image tiles.
- init_object()
- create_duplicate().Object
- to_String().String
- op==(Object other).Logical {multimethod}
- op<>(Object other).Logical {multimethod}
- type_name().String : native
- runtime_type().RuntimeType : native
- runtime_properties().RuntimeProperties
- runtime_methods().RuntimeMethods
- handle(Vector2 new_handle)
- handle(Handle h)
- angle(Radians new_angle)
- angle(Degrees deg)
- scale(Vector2 new_scale)
- scale(Real64 uniform_scale)
- point_filter(Logical setting)
- point_filter().Logical
- fixed_color(Logical setting)
- fixed_color().Logical
- texture_wrap(Logical setting)
- texture_wrap().Logical
- alpha().Int32
- alpha(Int32 new_alpha)
- bounding_box().Box
- bounding_circle().Circle
- draw(Real64 x,Real64 y)
- clear([Color c])
|