Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
GUIStaticText Class Reference
Inheritance diagram for GUIStaticText:
GUIElement

Public Member Functions

def __init__
 
def draw
 
def undraw
 
def setText
 
def setColor
 
def getText
 
def getColor
 
- Public Member Functions inherited from GUIElement
def __init__
 
def __str__
 
def __repr__
 
def show
 
def hide
 
def notifyNeedRedraw
 
def draw
 
def undraw
 
def redraw
 
def onMessage
 
def onClick
 
def onShow
 
def onHide
 
def onDraw
 
def onUndraw
 
def onRedraw
 
def focus
 
def setModal
 
def isInteractive
 

Data Fields

 index
 
 textstate
 
 location
 
 color
 
 bgcolor
 
 fontsize
 
 text
 
- Data Fields inherited from GUIElement
 room
 
 owner
 
 visible
 
 redrawPreservesZ
 
 id
 

Detailed Description

Definition at line 937 of file GUI.py.

Constructor & Destructor Documentation

def __init__ (   self,
  room,
  index,
  text,
  location,
  color,
  fontsize = 1.0,
  bgcolor = None,
  kwarg 
)

Definition at line 938 of file GUI.py.

939  def __init__(self,room,index,text,location,color,fontsize=1.0,bgcolor=None,**kwarg):
940  GUIElement.__init__(self,room,**kwarg)
941 
942  self.index=index
943  self.textstate = 0
944  self.location = location
945  self.color = color
946  if (bgcolor != None):
947  self.bgcolor = bgcolor
948  else:
949  self.bgcolor = GUIColor.clear()
950  self.fontsize = fontsize
951  self.text = text

Member Function Documentation

def draw (   self)
Creates the element 

Definition at line 952 of file GUI.py.

References GUIStaticText.fontsize, Tokenizer.index, ListReader.index, GUIRoom.index, GUIStaticImage.index, GUIStaticText.index, locale.str(), DialogBox.Text.text, DialogBox.Button.text, DialogBox.TextInput.text, EnqueueMoreText.text, DisplayTextIfTrueScript.text, AddPythonSprite.text, GUIStaticText.text, CampaignNode.text, and GUIStaticText.textstate.

953  def draw(self):
954  """ Creates the element """
955  if (self.textstate==0):
956  (x,y,w,h) = self.location.getTextRect()
957  # the dimensions for Base.TextBox are all screwed up. the (width height multiplier) value is actually (x2, y2, unused)
958  # and the text is always the same size, regardless of how the height or multiplier values get set
959  Base.TextBox(self.room.getIndex(), str(self.index), str(self.text), x, y, (x + w, y - h, self.fontsize), self.bgcolor.getRGB(), self.bgcolor.getAlpha(), self.color.getRGB())
960  if _doWhiteHack != 0:
961  """ ugly hack, needed to counter a stupid bug """
962  Base.TextBox(self.room.getIndex(),str(self.index)+"_white_hack","", -100.0, -100.0, (0.01, 0.01, 1), (0,0,0), 0, GUIColor.white().getRGB())
963  self.textstate=1
def getColor (   self)

Definition at line 984 of file GUI.py.

References GUIStaticText.color.

985  def getColor(self):
986  return self.color
987 
988 
989 """----------------------------------------------------------------"""
990 """ """
991 """ GUILineEdit - an interactive text box """
992 """ """
993 """----------------------------------------------------------------"""
994 
995 #todo: add optional frame
def getText (   self)

Definition at line 981 of file GUI.py.

References DialogBox.Text.text, DialogBox.Button.text, DialogBox.TextInput.text, EnqueueMoreText.text, DisplayTextIfTrueScript.text, AddPythonSprite.text, GUIStaticText.text, and CampaignNode.text.

982  def getText(self):
983  return self.text
def setColor (   self,
  newcolor 
)

Definition at line 977 of file GUI.py.

References GUIStaticText.color, GUIRoom.notifyNeedRedraw(), and GUIElement.notifyNeedRedraw().

978  def setColor(self,newcolor):
979  self.color = newcolor
980  self.notifyNeedRedraw()
def setText (   self,
  newtext 
)

Definition at line 972 of file GUI.py.

References Tokenizer.index, ListReader.index, GUIRoom.index, GUIStaticImage.index, GUIStaticText.index, locale.str(), DialogBox.Text.text, DialogBox.Button.text, DialogBox.TextInput.text, EnqueueMoreText.text, DisplayTextIfTrueScript.text, AddPythonSprite.text, GUIStaticText.text, CampaignNode.text, and GUIStaticText.textstate.

973  def setText(self,newtext):
974  self.text = newtext
975  if self.textstate==1:
976  Base.SetTextBoxText(self.room.getIndex(),str(self.index),str(self.text))
def undraw (   self)
Hides the element 

Definition at line 964 of file GUI.py.

References Tokenizer.index, ListReader.index, GUIRoom.index, GUIStaticImage.index, GUIStaticText.index, locale.str(), and GUIStaticText.textstate.

965  def undraw(self):
966  """ Hides the element """
967  if self.textstate==1:
968  Base.EraseObj(self.room.getIndex(),str(self.index))
969  if _doWhiteHack != 0:
970  Base.EraseObj(self.room.getIndex(),self.index+"_white_hack")
971  self.textstate=0

Field Documentation

bgcolor

Definition at line 946 of file GUI.py.

color

Definition at line 944 of file GUI.py.

fontsize

Definition at line 949 of file GUI.py.

index

Definition at line 941 of file GUI.py.

location

Definition at line 943 of file GUI.py.

text

Definition at line 950 of file GUI.py.

textstate

Definition at line 942 of file GUI.py.


The documentation for this class was generated from the following file: