Skip to content

Instantly share code, notes, and snippets.

@CoderPuppy
Created July 28, 2016 04:44
Show Gist options
  • Save CoderPuppy/0bb860907272c51ff9f3c67f073e21a9 to your computer and use it in GitHub Desktop.
Save CoderPuppy/0bb860907272c51ff9f3c67f073e21a9 to your computer and use it in GitHub Desktop.
-- outside is a ResourceContext for outside the application
-- inside is a ResourceContext for the application bundle
-- all these are bundled
local img = ImageParser.parse(inside.get('test-image.whatever-extension-here'))
local masterTheme = Theme.fromFile(inside.get('ui/master.theme'))
local layout = Layout.fromFile(inside.get('ui/master.tml'))
-- this is bundled
local api = CCAPI.load(inside.get('api'), outside)
api.somefunction('path/on/the/outside')
-- api2 depends on api
-- this is bundled
local api2 = CCAPI.load(inside.get('api2'), outside.override('api', inside.get('api')))
api2.someFunction()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment