Tutorials

Using namespaces

Namespaces are used to avoid cluttering the global namespace when defining functions, classes and variables which helps to avoid naming conflicts. read

Introduction to classes

A class is a construct that defines the data and behaviour of a particular type of object. Classes can be instantiated into objects. Tutorial provides a brief explanation of classes and describes how to define them the Capri way. read

Extending classes and polymorphism

New classes can be defined as an extension of existing classes. For example, the class Car could extend the abstract class Vehicle and thus inherit both its instance and static members. Tutorial explains how to extend classes with Capri and how to invoke super methods. read

Reflection with classes

Sometimes it is useful to determine what class an object is of, or what namespace a class belongs to. Reflection capabilities are available for all Capri classes. read

Dynamically including scripts and styles

Highly interactive web applications make extensive use of scripts and styles. For many reasons it is better modularise scripts and styles. Capri makes it easy to dynamically include scripts or styles as and when they are needed. read

Creating a widget

Capri provides an alternative widget architecture that integrates into jQuery and can be used alongside jQuery UI widgets. Capri widgets are implemented as classes and fully support namespaces. read

Using hooks

Hooks can be used to reduce the complexity of your logic, but most importantly they make it possible to extend or replace functionality without modifying the original scripts directly. read

Creating a game!

Special tutorial coming soon!