|
|
# rbGooey. -- Game GUI library to be used with rubygame
# Copyright (C) 2007 Han 'kiba' Dao
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#This class is the metaclass for a file driven interface system.
class Gui
attr_accessor :text , :input , :main , :name , :target
def initialize main
@main = main
@text = text
@text = TextMode.new(main)
@input = input
@input = nil
@parser = Parser.new(self)
@file = FileSys.new
@name = name
@target = target
@data
end
#load metadata
def load name
@data = XmlSimple.xml_in(name, {'KeyAttr' => 'name'})
end
#read a file from the metadata
def execute name , target
@target = target
@parser.data = XmlSimple.xml_in(@data['file'][name]['name'],{ 'KeyAttr' => 'name' })
end
def mouse
mqueue = MQueue.new
mqueue.mouse.name("data/mouse/mouse.png")
mqueue.queue(@text,@target,@name)
end
#opt1 is for wheather method read should also render the text
def read name , opt1 = true
#@parser.read(name)
#if opt1 == true
# @text.render_text()
#endpng
#@parser.input()
#return @input
end
end
./rbgooey/lib/gui.rb:42:in `[]': can't convert String into Integer (TypeError)
from ./rbgooey/lib/gui.rb:42:in `execute'
from ./lib/dynpetmenu.rb:30:in `menutext'
from ./lib/dynpetmenu.rb:27:in `initialize'
from ./lib/setup.rb:31:in `new'
from ./lib/setup.rb:31:in `initialize'
from dynpet.rb:65:in `new'
from dynpet.rb:65
data/dyngui/menu.dyngui
data/sharegui/optionmenu.dyngui
data/dyngui/filemenu.dyngui
data/dyngui/creation.dyngui
|