Image.createSurface

From Spheriki

Jump to: navigation, search

Convert the image into an object.


Contents

Usage

Surface image.createSurface();
  • image Sphere Image object. The image to convert.
  • Surface is returned, which is a Sphere Surface object holding the same image.


Examples

Once an image is in surface form, you can manipulate it just like any other surface.

var image = LoadImage("my_effect.png");
// do some image blitting
// ...
var surface = image.createSurface();
surface.replaceColor(CreateColor(0, 0, 0), CreateColor(127, 127, 127));
surface.blit(0, 0);
FlipScreen();
GetKey();


Notes

  • If you wish to load an image file as a surface, use LoadSurface().
  • Surface.createImage() will convert surfaces to images, so this provides a way to alter images at runtime.


See also

Personal tools