Getting Started with dmc-kompatible

Get quickly up-and-running with dmc-kompatible.

This is rough documentation, though it should be enough to get you started

Table of Contents

{toc:style=disc|indent=20px|minLevel=2|exclude=Table of Contents|printable=false}

Functionality

dmc-kompatible adds an extra layer on the native capabilities of the Corona SDK. It does this by adding functionality to each of the objects created by either the display or native object in Corona SDK.

Suggested Usage

  1. First, you can try to use the MAKE_GLOBAL option in the config file.

    This might not work, but it's the quickest method to make your app compatible. See [dmc_kompatible Documentation] for more details.

  2. Otherwise, put the module require() at the top of every file which needs it.

    You can do this by running your application and see in which file the first error occurs. Put a require() at the top of the file. Run the app again and see where the next error occurs. Put a require() at the top of the file ... etc, etc.

Import

Import the library module like so, and put this line at the top of each module:

Import DMC Kompatible

local display, native = require( 'dmc_kompatible' )()

That's all that's required. The library does the necessary modifications to the Corona engine so that it just works.

proper-importing
Type the line exactly like that:

  • parenthesis at the end
  • variables 'display' and 'native' at the beginning

General Functionality

Display Reference Points:

You can continue to access the reference points you have grown to know and love.

display.TopLeftReferencePoint
display.TopCenterReferencePoint
display.TopRightReferencePoint
display.CenterLeftReferencePoint
display.CenterReferencePoint
display.CenterRightReferencePoint
display.BottomLeftReferencePoint
display.BottomCenterReferencePoint
display.BottomRightReferencePoint

Overrides for Reference Point methods

setReferencePoint

Overrides for Color methods

setFillColor, setTextColor, setStrokeColor