LIL is a Language Make games, nicely

@container

A container is a basic box of content. It can contain other objects and draw a background.

Example code

#new @container test {
	width: 100;
	height: 100;
	backround: #0;
}

Virtual variables

  • componentId

    Type: vvar.i64

    The identifier of the box for this container.

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

    Type: vvar.f32

    How wide the container is.

    theContainer.width: 100;
  • height

    Type: vvar.f32

    How tall the container is.

    var height: theContainer.height;
  • background

    Type: vvar.@rgb

    A color object representing the background color of this container.

    theContainer.background: #F00;
  • x

    Type: vvar.f32

    The position along the horizontal axis.

    theContainer.x +: 100;
  • y

    Type: vvar.f32

    The position along the vertical axis.

    theContainer.y -: 20;
  • z

    Type: vvar.f32

    The position along the direction of the depth.

    theContainer.z: 0;
  • velocity

    Type: vvar.@vel

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

    theContainer.velocity: @vel { x: 3; y: 5 };

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 container into the ECS.

    Arguments
    • var.ptr(i8) name:

      The name of the new container.

    • var.i64 parentId:

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

    var theContainer: @container { };
    theContainer.initialize(`myContainer`, 0);
  • setWidth

    Type: fn(f32)

    Setter for the width vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the width.

    theContainer.setWidth(100);
  • getWidth

    Type: fn => f32

    Getter for the width vvar.

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

    Type: fn(f32)

    Setter for the height vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the height.

  • getHeight

    Type: fn => f32

    Getter for the height vvar.

    print theContainer.getHeight();
  • setBackground

    Type: fn(@rgb)

    Setter for the background vvar.

    Arguments
    • var.@rgb value:

      The color with which to draw the background.

    theContainer.setBackground(myBgColor);
  • getBackground

    Type: fn => @rgb

    Value accessor for the background vvar.

    var color: theContainer.getBackground();
  • getBackgroundPointer

    Type: fn => ptr(@rgb)

    Pointer accessor for the background vvar.

    var colorPtr: theContainer.getBackgroundPointer();
  • setX

    Type: fn(f32)

    Setter for the x vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the x coordinate.

    theContainer.setX(200);
  • getX

    Type: fn => f32

    Getter for the x vvar.

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

    Type: fn(f32)

    Setter for the y vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the y coordinate.

    theContainer.setY(0);
  • getY

    Type: fn => f32

    Getter for the y vvar.

    var currentY: theContainer.getY();
  • setZ

    Type: fn(f32)

    Setter for the z vvar.

    Arguments
    • var.f32 value:

      The number in pixels for the z coordinate.

    theContainer.setZ(0);
  • getZ

    Type: fn => f32

    Getter for the z vvar.

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

    Type: fn(@vel)

    Setter for the velocity vvar.

    Arguments
    • var.@vel value:

      A vector describing the velocitiy of the container.

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

    Type: fn => @vel

    Value accessor for the velocity vvar.

    var vel: theContainer.getVelocity();
  • getVelocityPointer

    Type: fn => ptr(@vel)

    Pointer accessor for the volicity vvar.