Hey there
I've been trying to develop a replay viewer with the DeScript.
Developping is a hobby for me, and I'm not that used yet with object orienting developement.
I'm stuck at one part when trying to use DeGUI.Image.
local ARV = class(DeGUI.Frame,function(self)
local w,h = DeGUI:size()
local framew,frameh = 250, 50
left_but = load_texture("images/arrowL.tga")
right_but = load_texture("images/arrowR.tga")
self._base.init(self,((w/2) - framew/2), h - 100 ,framew, frameh)
--self:child('iLeftArrow',DeGUI.Image(5,5,40,40,'images/arrowL.tga'))
--self:child('iLeftArrow',DeGUI.Quad(5,5,40,40))
end)
function ARV:draw2D()
self._base.draw2D(self)
local x,y = self:abspos()
set_color(unpack(DeScript.colors.Text))
draw_quad(x+5,y+5,40,40,left_but)
draw_quad(x+205,y+5,40,40,right_but)
end
So my code there works. It does display two arrows in my created-frame.
I'm aware this does sucks. As you can see commented, at first I have tried to add a DeGUI.Image as a child of my gui.
The trouble is when loading the texture. I get this error message :
Lua script error: ./data/script/DeScript.lua:317: bad argument #1 to 'load_texture' (string expected, got nil)
(The .Quad does work though and displays a white square.)
Apparently I did something wrong, and DeScript is not able to load the texture.
Could you (DeFransen or anyone that could help) give me some sample of code that would allow me to "child" .Image correctly please ?
Also, this DeScript is HUGE. I mean this is really an incredible work. As I said, I'm just a hobbyist, and getting further and further in it, I'm just amazed, and some times overwhelmed.
@DeFransen : Can't wait to see what you will come up with for the mod creator ;)
Also if you want tips and feedback for the mod creator, I advise you to PM MrPoptart and/or visit
this thread about Mod Team that might interest you.
See ya ;)
EDIT : Also a forum mod should rename the thread to v1.0.
Last edited by Kyat; Apr 20, 2010 at 01:04 AM.