Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

createImage()

Purpose

Create an image

Description

Create an image of the specified size and type which can then be drawn onto

Syntax

handle = createImage( width, height, filter, type )

Arguments

handle Variable which stores the desired image file

width Desired on-screen width in pixels

height Desired on-screen height in pixels

filter Sets filtering on (true) or off (false) - generally on for real images and off for pixel art

type The type of the image: image_rgb for 24 bits per pixel, image_rgba for 32bpp with alpha channel, image_rgb_hdr for 48bpp, image_rgba_hdr for 64 bpp with alpha channel

Example

w = 200
// Create a tile
img = createImage( w, w, true, image_rgb )
setDrawTarget( img )
box( 0, 0, w, w, red, 0 )
box( 0, w/2, w - 1, w / 2, white, 1 )
line( { w / 2 }, { w / 2, w / 2 }, white )
// draw tiles on the screen
setDrawTarget( frameBuffer )
for y = 1 to gHeight() step w loop
    for x = 1 to gWidth() step w loop
        drawImage( img, x, y, 1 )
        update()
        sleep( 0.2 )
    repeat
repeat
sleep( 3 )

Associated Commands

clear(), drawImage(), drawImageEx(), drawQuad(), drawSheet(), loadImage(), update(), uploadImage()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.