Sounds like what I am looking for. Pity not possible for osx though.
Mike
Moderators: Fahim, selgin, Agent_Smith, Tori, Belgarath, slowtiger
mykylr wrote:Sounds like what I am looking for. Pity not possible for osx though.
Mike
Rudiger wrote:
...... write a quick AS lua script with the line:
require "gd"
.
ulrik wrote:Rudiger wrote:
...... write a quick AS lua script with the line:
require "gd"
.
How would I do that, and where?
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************
ScriptName = "RT_GDTest"
-- **************************************************
-- General information about this script
-- **************************************************
RT_GDTest = {}
function RT_GDTest:Name()
return "GD Test Script"
end
function RT_GDTest:Version()
return "0.1"
end
function RT_GDTest:Description()
return "Quick test script for testing GD library"
end
function RT_GDTest:Creator()
return "Rudiger"
end
function RT_GDTest:UILabel()
return "RT: GD Test"
end
function RT_GDTest:LoadPrefs(prefs)
end
function RT_GDTest:SavePrefs(prefs)
end
function RT_GDTest:ResetPrefs()
end
-- **************************************************
-- Recurring values
-- **************************************************
-- **************************************************
-- The guts of this script
-- **************************************************
require "gd"
function RT_GDTest:Run(moho)
-- If you are feeling adventurous, you could try out some gd functions here, eg
local layer = moho.layer
local layerImage, im
if layer:LayerType() == MOHO.LT_IMAGE then
layerImage = moho:LayerAsImage(layer):SourceImage()
im = gd.createFromPng(layerImage)
end
end
There's a pretty comprehensive list of add-ons for Lua here:
http://lua-users.org/wiki/LibrariesAndBindings


Users browsing this forum: No registered users and 0 guests