This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# EventMngr | |
| -- ############## START of EVENT MANAGER ################## | |
| -- <a href="/talk/profile/tnlogy">@tnlogy</a> & <a href="/talk/profile/JMV38">@JMV38</a> & <a href="/talk/profile/Briarfox">@Briarfox</a> | |
| -- example of usage: | |
| -- EventMngr:extend(evMngr) -- extend an existing table with event manager funcs | |
| -- evMngr:on("touch",func) -- register func() to fire on "touch" event | |
| -- evMngr:on("touch", obj.func, obj) -- register obj:func() to fire on "touch" event | |
| -- evMngr:trigger("touch",10,50) -- fires func(10,50) and obj:func(10,50) | |
| -- evMngr:off("touch", func) -- unregister func() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# fft | |
| -- fft | |
| function realToCplx(iTable) | |
| cplx = {} | |
| for i,v in ipairs(iTable) do | |
| cplx[i-1] = { r=v, i=0} | |
| end | |
| return cplx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --# Main | |
| -- blendmode bench | |
| displayMode(STANDARD) | |
| function setup() | |
| -- default colors | |
| DST_background = color(0,0) | |
| DST_foreground = color(255, 0, 0, 255) | |
| SRC_background = color(0,0) | |
| SRC_foreground = color(35, 0, 255, 255) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- In setup | |
| iapItems = {} | |
| registerItem("itemIDOne") | |
| registerItem("itemIDTwo") | |
| initStore() | |
| storeReady = false | |
| purchasePending = false | |
| -- Purchasing the item | |
| purchaseItem(itemNum) -- Number of the item registered in order; i.e. 0 would be 'itemIDOne' and 1 would be 'itemIDTwo' |