LIL is a Language Make games, nicely

@image

An image is a box with a texture.

Example code

#new @image logo {
	src: "logo.png";
	x: 20;
	y: 10;
}

Virtual variables

  • componentId

    Type: vvar.i64

    The identifier of the data for this image.

    app.imgs[@self.componentId].width: value;
  • width

    Type: vvar.f32

    How wide the image is.

    theImage.width: 100;
  • height

    Type: vvar.f32

    How tall the image is.

    var height: theImage.height;
  • x

    Type: vvar.f32

    The position along the horizontal axis.

    theImage.x +: 100;
  • y

    Type: vvar.f32

    The position along the vertical axis.

    theImage.y -: 20;
  • z

    Type: vvar.f32

    The position along the direction of the depth.

    theImage.z: 0;
  • velocity

    Type: vvar.@vel

    The speed at which this image should move, in pixels per 60th of a second.

    theImage.velocity: @vel { x: 3; y: 5 };
  • src

    Type: vvar.ptr(@string)

    A string containing the file path for the resource. Returns the string as a cstr.

    theImage.src: "sprite.png";

Member variables

  • super

    Type: var.@element

    The @element superclass. This field is expanded and gives this class its id field.

    var elem: @self.super;

Member functions

  • getComponentId

    Type: fn => i64

    Accessor for the componentId vvar.

    var componentId: @self.getComponentId();
  • initialize

    Type: fn(ptr(i8),i64) => i64

    This method installs a new image into the ECS.

    Arguments
    • var.ptr(i8) name:

      The name of the new image.

    • var.i64 parentId:

      The id of the parent of the new image. Defaults to 0, which is the id of the @root object.

    var theImage: @image { };
    theImage.initialize(`myImage`, 0);
  • setWidth

    Type: fn(f32)

    Setter for the width vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the width.

    theImage.setWidth(100);
  • getWidth

    Type: fn => f32

    Getter for the width vvar.

    if theImage.getWidth() > 200 {
    	//etc
    }
  • setHeight

    Type: fn(f32)

    Setter for the height vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the height.

    theImage.setHeight(200);
  • getHeight

    Type: fn => f32

    Getter for the height vvar.

    print theImage.getHeight();
  • setX

    Type: fn(f32)

    Setter for the x vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the x coordinate.

    theImage.setX(200);
  • getX

    Type: fn => f32

    Getter for the x vvar.

    if theImage.getX() > 100 {
    	//etc
    }
  • setY

    Type: fn(f32)

    Setter for the y vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the y coordinate.

    theImage.setY(0);
  • getY

    Type: fn => f32

    Getter for the y vvar.

    var currentY: theImage.getY();
  • setZ

    Type: fn(f32)

    Setter for the z vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the z coordinate.

    theImage.setZ(0);
  • getZ

    Type: fn => f32

    Getter for the z vvar.

    if theImage.getZ() > 0 {
    	//etc
    }
  • setVelocity

    Type: fn(@vel)

    Setter for the velocity vvar.

    Arguments
    • var.@vel value:

      A vector describing the velocitiy of the image.

    theImage.setVelocity(@vel {
    	x: 2;
    	y: 0;
    });
  • getVelocity

    Type: fn => @vel

    Value accessor for the velocity vvar.

    var vel: theImage.getVelocity();
  • getVelocityPointer

    Type: fn => ptr(@vel)

    Pointer accessor for the volicity vvar.

    var ptrToVel: theImage.getVelocityPointer();
  • setSrc

    Type: fn(ptr(@string))

    Setter for the src vvar.

    Arguments
    • var.ptr(@string) value:

      A string containing the path to the image inside the Resources folder.

    theImage.setSrc("newImage.png");
  • getSrc

    Type: fn => ptr(i8)

    Getter for the src vvar.

    print theImage.getSrc();
  • load

    Type: fn(ptr(@string))

    Loads a new image into the system, creating the new texture.

    Arguments
    • var.ptr(@string) value:

      A string containing the path to the image inside the Resources folder.