本文整理汇总了Python中Blender.BGL.glClearColor方法的典型用法代码示例。如果您正苦于以下问题:Python BGL.glClearColor方法的具体用法?Python BGL.glClearColor怎么用?Python BGL.glClearColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blender.BGL
的用法示例。
在下文中一共展示了BGL.glClearColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def __init__(self, background):
## Basic background colour.
BGL.glClearColor(background[0],background[1],background[2],background[3])
## Clear the OpenGL script window to background colour.
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
## Create a buffer space for the values we're after.
scissorbox=BGL.Buffer(BGL.GL_FLOAT,4)
## Get the openGL window size values.
BGL.glGetFloatv(BGL.GL_SCISSOR_BOX,scissorbox)
## The scissorbox values are floats, so we change them to integers. This prevents protests from Python about "int expected".
## The left and base values are mainly used to calculate the position of the mouse x and y values.
# Left side of the OpenGL script window. Value is in pixels, from the left side of the main Blender window.
self.left=int(scissorbox[0])
# Bottom of the OpenGL script window.Value is in pixels, up from the bottom of the main Blender window.
self.base=int(scissorbox[1])
# Width of the OpenGL script window.
self.width=int(scissorbox[2])
# Height of the OpenGL script window.
self.height=int(scissorbox[3])
示例2: updateStatus
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def updateStatus(status):
global gStatus
gStatus = status
BGL.glClearColor(0.392,0.396,0.549,1)
BGL.glClear(Blender.BGL.GL_COLOR_BUFFER_BIT)
size = Blender.Window.GetAreaSize()
isize = drawHeader(size)
BGL.glColor3f(1.0,1.0,1.0)
yval = size[1]-isize[1] - 40
Blender.BGL.glRasterPos2i(60, yval)
Blender.Draw.Text('Status:','normal')
if type(gStatus) == types.ListType:
for s in gStatus:
Blender.BGL.glRasterPos2i(105, yval)
Blender.Draw.Text(s,'normal')
yval = yval - 18
else:
Blender.BGL.glRasterPos2i(105, yval)
Blender.Draw.Text(gStatus,'normal')
yval = yval - 18
Blender.Redraw()
示例3: draw
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def draw(): # Define the draw function (which draws your GUI).
global EVENT_Button
global EVENT_Type
global EVENT_shtoguntype
global EVENT_String
global EVENT_Bitmap
global EVENT_WVTU_1
global Object_Button
global Object_Type
global Object_shtoguntype
global Object_String
global Object_Bitmap
global Object_WVTU_1
BGL.glClearColor(0.244564, 0.244406, 0.244406, 0.0)
BGL.glClear(GL_COLOR_BUFFER_BIT)
BGL.glColor3f(1.000000, 1.000000, 1.000000)
Object_Button = Draw.Button("Connect to Shotgun", EVENT_Button, 20, 8, 200, 20, "")
BGL.glRasterPos2i(100, 108)
Object_Type = Draw.Text("Type")
Object_shtoguntype = Draw.Menu("Asset", EVENT_shtoguntype, 20, 100, 60, 20, Object_shtoguntype.val, "Type of Shotgun entry")
Object_String = Draw.String("id : ", EVENT_String, 20, 60, 60, 20,Object_String.val, 399, "ID # for the Shotgun entry")
BGL.glRasterPos2i(24, 210)
BGL.glDrawPixels(0, 0, GL_RGB, GL_UNSIGNED_BYTE, Object_Bitmap)
BGL.glRasterPos2i(24, 152)
Object_WVTU_1 = Draw.Text("WVTU "+VERSION+"")
示例4: drawGUI
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def drawGUI():
""" Create and draw the GUI. """
HEIGHT = 382
CONTROL_WIDTH = 400
BGL.glClearColor(0.6, 0.6, 0.6, 1.0)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3f(0.75, 0.75, 0.75)
BGL.glRecti(3,45,CONTROL_WIDTH,3)
stitchOffset = 22
HEIGHT += stitchOffset * num_motions_button.val
Display_Title_Bar(HEIGHT,25, CONTROL_WIDTH)
Display_File_Bar(HEIGHT - 25, 71 + stitchOffset * num_motions_button.val, CONTROL_WIDTH)
Display_Mesh_Bar(HEIGHT - 96 - stitchOffset * num_motions_button.val, 48, CONTROL_WIDTH)
Display_Camera_Bar(HEIGHT - 144 - stitchOffset * num_motions_button.val, 112, CONTROL_WIDTH)
Display_Render_Bar(HEIGHT - 256 - stitchOffset * num_motions_button.val, 48, CONTROL_WIDTH)
Display_Output_Bar(HEIGHT - 304 - stitchOffset * num_motions_button.val, 48, CONTROL_WIDTH)
Draw.PushButton('Load simulation', SimulationButton, 9, 8, (CONTROL_WIDTH / 2) - 9, 18, 'Load simulation')
if hasLoaded:
Draw.PushButton('Render scene', RenderButton, (CONTROL_WIDTH / 2) + 3, 8, (CONTROL_WIDTH / 2) - 9, 18, 'Render scene')
示例5: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui():
BGL.glClearColor(1,1,1,1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
# idle
Draw.Label("Idle-Animation:", 10,200,180,20)
Draw.Number("von ", 1, 10,180,90,20,idleStartFrame,0,1000, "", button_event, 1,1)
Draw.Number("bis ", 2, 110,180,90,20,idleEndFrame,0,1000, "", button_event, 1,1)
# move
Draw.Label("Move-Animation:", 10,150,180,20)
Draw.Number("von ", 3, 10,130,90,20,moveStartFrame,0,1000, "", button_event, 1,1)
Draw.Number("bis ", 4, 110,130,90,20,moveEndFrame,0,1000, "", button_event, 1,1)
# attack
Draw.Label("Attack-Animation:", 10,90,180,20)
Draw.Number("von ", 5, 10,70,90,20,attackStartFrame,0,1000, "", button_event, 1,1)
Draw.Number("bis ", 6, 110,70,90,20,attackEndFrame,0,1000, "", button_event, 1,1)
# die
Draw.Label("Die-Animation:", 10,40,180,20)
Draw.Number("von ", 7, 10,20,90,20,dieStartFrame,0,1000, "", button_event, 1,1)
Draw.Number("bis ", 8, 110,20,90,20,dieEndFrame,0,1000, "", button_event, 1,1)
# RENDER-Button:
Draw.Button("RENDER", 9, 230,30,80,20, "RENDER!", renderButtonClicked)
示例6: import_gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def import_gui():
global filename, fileinput, impstatus
# Clear drawing area.
BGL.glClearColor(0.9,0.9,0.9,1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
# Status.
BGL.glRasterPos2i(10,8)
if impstatus == 0:
BGL.glColor3f(0.0,0.0,0.0)
Draw.Text('Importer ready.','tiny')
elif impstatus == 1:
BGL.glColor3f(0.0,0.75,0.0)
Draw.Text('Importing...','tiny')
elif impstatus == 2:
BGL.glColor3f(0.75,0.0,0.0)
Draw.Text('File not found!','tiny')
# Filename input box.
BGL.glRasterPos2i(10,20)
w = Draw.Text('File to import:')
Draw.Button(filename, 3, w+15, 15, 200,20)
#fileinput = Draw.String('',3, w+15,15, 200,20, filename, 512,
# 'Filename to import.')
Draw.Button('Import', 1, w+15+210,15, 40,20)
Draw.Button('Quit', 2, w+15+210+50,15, 40,20)
示例7: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui():
global buttons, offsets, rows, cols
size=BGL.Buffer(BGL.GL_FLOAT, 4)
BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size)
size=size.list
xoff=PANELPAD
yoff=int(size[3])
# Default theme
text =[ 0, 0, 0, 255]
text_hi=[255, 255, 255, 255]
header =[165, 165, 165, 255]
panel =[255, 255, 255, 40]
back =[180, 180, 180, 255]
# Actual theme
if Blender.Get('version') >= 235:
theme=Blender.Window.Theme.Get()
if theme:
theme=theme[0]
text=theme.get('ui').text
space=theme.get('buts')
text_hi=space.text_hi
header=space.header
header=[max(header[0]-30, 0), # 30 appears to be hard coded
max(header[1]-30, 0),
max(header[2]-30, 0),
header[3]]
panel=space.panel
back=space.back
BGL.glEnable (BGL.GL_BLEND)
BGL.glBlendFunc (BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA)
BGL.glClearColor(float(back[0])/255, float(back[1])/255, float(back[2])/255, 1)
BGL.glClear (BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor4ub(*header)
BGL.glRectd(xoff, yoff-PANELTOP, xoff-PANELINDENT+PANELWIDTH, yoff-PANELTOP-PANELHEAD)
BGL.glColor4ub(*panel)
BGL.glRectd(xoff, yoff-PANELTOP-PANELHEAD, xoff-PANELINDENT+PANELWIDTH, yoff-60-PANELINDENT-rows*CONTROLSIZE)
BGL.glColor4ub(*text_hi)
BGL.glRasterPos2d(xoff+PANELINDENT, yoff-23)
Draw.Text("Fixup UV mapping")
BGL.glColor4ub(*text)
BGL.glRasterPos2d(xoff+PANELINDENT, yoff-48)
Draw.Text("Select where the old image is located in the new:")
buttons=[]
for i in range(rows):
for j in range(cols):
buttons.append(Draw.Button('', len(buttons)+CANCEL+1, xoff+PANELINDENT+j*CONTROLSIZE, yoff-80-i*CONTROLSIZE, CONTROLSIZE, CONTROLSIZE))
buttons.append(Draw.Button("Cancel", CANCEL, xoff-PANELINDENT*2+PANELWIDTH-4*CONTROLSIZE, yoff-60-rows*CONTROLSIZE, 4*CONTROLSIZE, CONTROLSIZE))
示例8: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui():
global copynorm, copystrp
size=BGL.Buffer(BGL.GL_FLOAT, 4)
BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size)
size=size.list
x=int(size[2])
y=int(size[3])
# Default theme
text =[ 0, 0, 0, 255]
text_hi=[255, 255, 255, 255]
header =[195, 195, 195, 255]
panel =[255, 255, 255, 40]
back =[180, 180, 180, 255]
# Actual theme
if Blender.Get('version') >= 235:
theme=Blender.Window.Theme.Get()
if theme:
theme=theme[0]
space=theme.get('buts')
text=theme.get('ui').text
text_hi=space.text_hi
header=space.header
panel=space.panel
back=space.back
BGL.glEnable (BGL.GL_BLEND)
BGL.glBlendFunc (BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA)
BGL.glClearColor (float(back[0])/255, float(back[1])/255,
float(back[2])/255, 1)
BGL.glClear (BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor4ub (max(header[0]-30, 0), # 30 appears to be hard coded
max(header[1]-30, 0),
max(header[2]-30, 0),
header[3])
BGL.glRectd(7, y-8, 295, y-28)
BGL.glColor4ub (panel[0], panel[1], panel[2], panel[3])
BGL.glRectd(7, y-28, 295, y-130)
BGL.glColor4ub (text_hi[0], text_hi[1], text_hi[2], text_hi[3])
BGL.glRasterPos2d(16, y-23)
Draw.Text("UV Copy & Paste")
BGL.glColor4ub (text[0], text[1], text[2], text[3])
BGL.glRasterPos2d(16, y-48)
Draw.Text("Select the faces to paint and then press Paste")
BGL.glRasterPos2d(16, y-75)
Draw.Text("Copy type:", "small")
copynorm = Draw.Toggle("Normal", 3, 73, y-79, 51, 17, copynorm.val,
"Copy texture to selected faces in the same or a different mesh")
copystrp = Draw.Toggle("Strip", 4, 124, y-79, 51, 17, copystrp.val,
"Reverse copied texture as necessary to make a strip in the same mesh")
Draw.Button("Paste", 2, 14, y-120, 100, 26)
Draw.Button("Cancel", 1, 187, y-120, 100, 26)
示例9: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui(): # the function to draw the screen
global mystring, mymsg, toggle
if len(mystring) > 90: mystring = ""
BGL.glClearColor(0,0,1,1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3f(1,1,1)
Draw.Toggle("Toggle", 1, 10, 10, 55, 20, toggle,"A toggle button")
BGL.glRasterPos2i(72, 16)
if toggle: toggle_state = "down"
else: toggle_state = "up"
Draw.Text("The toggle button is %s." % toggle_state, "small")
BGL.glRasterPos2i(10, 230)
Draw.Text("Type letters from a to z, ESC to leave.")
BGL.glRasterPos2i(20, 200)
Draw.Text(mystring)
BGL.glColor3f(1,0.4,0.3)
BGL.glRasterPos2i(340, 70)
Draw.Text(mymsg, "tiny")
示例10: displayWarnings
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def displayWarnings():
BGL.glClearColor(0.392,0.396,0.549,1)
BGL.glClear(Blender.BGL.GL_COLOR_BUFFER_BIT)
size = Blender.Window.GetAreaSize()
isize = drawHeader(size)
BGL.glColor3f(1.0,1.0,0.0)
yval = size[1]-isize[1] - 40
Blender.BGL.glRasterPos2i(50, yval)
Blender.Draw.Text('Warnings:','normal')
BGL.glColor3f(1.0,1.0,1.0)
for s in gWarnings:
Blender.BGL.glRasterPos2i(115, yval)
Blender.Draw.Text(s,'normal')
yval = yval - 18
Blender.Draw.PushButton('Back', ID_BACK, 105, 10, 100, 20, 'Back To Exporter')
示例11: gui_draw
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui_draw():
from Blender import BGL, Draw
(width, height) = Blender.Window.GetAreaSize()
BGL.glClearColor(0.4, 0.4, 0.45, 1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3f(1, 1, 1)
BGL.glRasterPos2f(5, 55)
Draw.Text("FlightGear YASim Import: '%s'" % Global.path)
Draw.PushButton("Reload", RELOAD_BUTTON, 5, 5, 80, 32, "reload YASim config file")
Global.mirror_button = Draw.Toggle("Mirror", MIRROR_BUTTON, 100, 5, 50, 16, Global.mirror_button.val, \
"show symmetric surfaces on both sides (reloads config)")
Draw.PushButton("Update Cursor", CURSOR_BUTTON, width - 650, 5, 100, 32, "update cursor display (in YASim coordinate system)")
BGL.glRasterPos2f(width - 530 + Blender.Draw.GetStringWidth("Vector from last") - Blender.Draw.GetStringWidth("Current"), 24)
Draw.Text("Current cursor pos: x = %+.3f y = %+.3f z = %+.3f" % tuple(Global.cursor))
c = Global.cursor - Global.last_cursor
BGL.glRasterPos2f(width - 530, 7)
Draw.Text("Vector from last cursor pos: x = %+.3f y = %+.3f z = %+.3f length = %.3f m" % (c[0], c[1], c[2], c.length))
示例12: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui(self): # the function to draw the screen
BGL.glClearColor(0,0,0.5,1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3f(1,1,1)
BGL.glRasterPos2i(20,200)
Draw.Text("Select the object to export:", "normal")
self.objMenu = Draw.Menu(self.sObjSelection, 1, 20, 170, 200, 20, self.objSel, "Select the animated object.")
BGL.glRasterPos2i(20,150)
Draw.Text("Select the armature to export:", "normal")
self.armMenu = Draw.Menu(self.sArmSelection, 2, 20, 120, 200, 20, self.armSel, "Select the matching armature.")
BGL.glRasterPos2i(20,100)
Draw.Text("Select the root bone of the armature:", "normal")
self.boneMenu = Draw.Menu(self.sBoneSelection, 3, 20, 70, 200, 20, self.boneSel, "Select the Root Bone of the armature.")
Draw.PushButton("Export", 4, 250, 150, 50, 20, "Export File")
Draw.PushButton("Cancel", 5, 250, 110, 50, 20, "Cancel")
BGL.glRasterPos2i(72, 16)
string = "Selections: " + ("%s" % self.objSel) + " / " + ("%s" % self.armSel) + " / " + ("%s" % self.boneSel)
Draw.Text(string, "small")
示例13: _draw
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def _draw(self):
BGL.glClearColor(*self.bg_color)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
for el in self.element:
el.draw()
示例14: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui():
global dataref_m, dataref_b, indices_b, indices_t, vals_b, clear_b, loops_b
global hideshow_m, from_b, to_b, up_b, down_b, delete_b, addhs_b
global cancel_b, apply_b
global manipulator_m, manipulator_b, cursor_m, cursor_b
dataref_m=[]
dataref_b=[]
indices_b=[]
indices_t=[]
vals_b=[]
clear_b=None
loops_b=[]
hideshow_m=[]
from_b=[]
to_b=[]
up_b=[]
down_b=[]
delete_b=[]
addhs_b=None
cancel_b=None
apply_b=None
# Default theme
text =[ 0, 0, 0, 255]
text_hi=[255, 255, 255, 255]
header =[165, 165, 165, 255]
panel =[255, 255, 255, 40]
back =[180, 180, 180, 255]
error =[255, 80, 80, 255] # where's the theme value for this?
# Actual theme
if Blender.Get('version') >= 235:
theme=Blender.Window.Theme.Get()
if theme:
theme=theme[0]
space=theme.get('buts')
text=theme.get('ui').text
text_hi=space.text_hi
header=space.header
header=[max(header[0]-30, 0), # 30 appears to be hard coded
max(header[1]-30, 0),
max(header[2]-30, 0),
header[3]]
panel=space.panel
back=space.back
size=BGL.Buffer(BGL.GL_FLOAT, 4)
BGL.glGetFloatv(BGL.GL_SCISSOR_BOX, size)
size=size.list
x=int(size[2])
y=int(size[3])
BGL.glEnable(BGL.GL_BLEND)
BGL.glBlendFunc(BGL.GL_SRC_ALPHA, BGL.GL_ONE_MINUS_SRC_ALPHA)
BGL.glClearColor(float(back[0])/255, float(back[1])/255, float(back[2])/255, 1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
yoff=y-offset[1]
if vertical:
xoff=PANELPAD+PANELINDENT-offset[0]
for boneno in range(bonecount):
eventbase=boneno*EVENTMAX
framecount=len(vals[boneno])
if not vertical:
xoff=PANELPAD+boneno*(PANELWIDTH+PANELPAD)+PANELINDENT-offset[0]
BGL.glColor4ub(*header)
BGL.glRectd(xoff-PANELINDENT, yoff-PANELTOP, xoff-PANELINDENT+PANELWIDTH, yoff-PANELTOP-PANELHEAD)
BGL.glColor4ub(*panel)
BGL.glRectd(xoff-PANELINDENT, yoff-PANELTOP-PANELHEAD, xoff-PANELINDENT+PANELWIDTH, yoff-170-(CONTROLSIZE-1)*framecount)
txt='parent bone'
if boneno: txt='grand'+txt
txt='great-'*(boneno-1)+txt
txt=txt[0].upper()+txt[1:]
BGL.glColor4ub(*text_hi)
BGL.glRasterPos2d(xoff, yoff-23)
Draw.Text(txt)
Draw.Label("Dataref:", xoff-4, yoff-54, 100, CONTROLSIZE)
BGL.glColor4ub(*error) # For errors
(valid,mbutton,bbutton,ibutton,tbutton)=drawdataref(datarefs, indices, eventbase, boneno, xoff-4, yoff-80)
dataref_m.append(mbutton)
dataref_b.append(bbutton)
indices_b.append(ibutton)
indices_t.append(tbutton)
vals_b.append([])
if valid:
# is a valid or custom dataref
Draw.Label("Dataref values:", xoff-4, yoff-132, 150, CONTROLSIZE)
for i in range(framecount):
Draw.Label("Frame #%d:" % (i+1), xoff-4+CONTROLSIZE, yoff-152-(CONTROLSIZE-1)*i, 100, CONTROLSIZE)
if i>1:
v9='v9: '
else:
v9=''
vals_b[-1].append(Draw.Number('', i+VALS_B+eventbase, xoff+104, yoff-152-(CONTROLSIZE-1)*i, 80, CONTROLSIZE, vals[boneno][i], -NUMBERMAX, NUMBERMAX, v9+'The dataref value that corresponds to the pose in frame %d' % (i+1)))
#.........这里部分代码省略.........
示例15: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glClearColor [as 别名]
def gui(): # drawing the screen
global SCREEN, START_SCREEN, CONFIG_SCREEN, KEYMENUS, LABELS
global BEVT_KEYMENU, BUT_KEYMENU, CFGKEY
global BUT_TYPES, SCROLL_DOWN, VARS_NUM
WIDTH, HEIGHT = Window.GetAreaSize()
theme = Theme.Get()[0]
tui = theme.get('ui')
ttxt = theme.get('text')
COL_BG = float_colors(ttxt.back)
COL_TXT = ttxt.text
COL_TXTHI = ttxt.text_hi
BGL.glClearColor(COL_BG[0],COL_BG[1],COL_BG[2],COL_BG[3])
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3ub(COL_TXT[0],COL_TXT[1], COL_TXT[2])
if SCREEN == START_SCREEN:
x = 10
y = 10
h = 20
w = 90
BGL.glRasterPos2i(x, y)
Draw.Text('Select a configuration key to access it. Press Q or ESC to leave.')
km_len = len(KEYMENUS)
km_columns = (WIDTH - x) / w
if km_columns == 0: km_rows = km_len
else:
km_rows = km_len / km_columns
if (km_len % km_columns): km_rows += 1
if km_rows == 0: km_rows = 1
ystart = y + 2*h*km_rows
if ystart > (HEIGHT - 70): ystart = HEIGHT - 70
y = ystart
column = 1
for i, km in enumerate(KEYMENUS):
column += 1
BGL.glRasterPos2i(x + 2, y + h + 5)
Draw.Text(LABELS[i])
BUT_KEYMENU[i] = Draw.Menu(km, BEVT_KEYMENU[i],
x, y, w - 10, h, 0, 'Choose a key to access its configuration data')
if column > km_columns:
column = 1
y -= 2*h
if y < 35: break
x = 10
else: x += w
x = 10
y = 50 + ystart
BGL.glColor3ub(COL_TXTHI[0], COL_TXTHI[1], COL_TXTHI[2])
BGL.glRasterPos2i(x, y)
Draw.Text('Scripts Configuration Editor')
Draw.PushButton('help', BEVT_HELP, x, 22, 45, 16,
'View help information about this script (hotkey: H)')
elif SCREEN == CONFIG_SCREEN:
x = y = 10
h = 18
data = CFGKEY.sorteddata
tips = CFGKEY.tips
fromdisk = CFGKEY.fromdisk
limits = CFGKEY.limits
VARS_NUM = 0
for k in data.keys():
VARS_NUM += len(data[k])
lines = VARS_NUM + 5 # to account for header and footer
y = lines*h
if y > HEIGHT - 20: y = HEIGHT - 20
BGL.glColor3ub(COL_TXTHI[0],COL_TXTHI[1], COL_TXTHI[2])
BGL.glRasterPos2i(x, y)
Draw.Text('Scripts Configuration Editor')
y -= 20
BGL.glColor3ub(COL_TXT[0],COL_TXT[1], COL_TXT[2])
txtsize = 10
if HEIGHT < lines*h:
BGL.glRasterPos2i(10, 5)
txtsize += Draw.Text('Arrow keys or mouse wheel to scroll, ')
BGL.glRasterPos2i(txtsize, 5)
Draw.Text('Q or ESC to return.')
BGL.glRasterPos2i(x, y)
Draw.Text('Key: "%s"' % CFGKEY.name)
bh = 16
bw = 45
by = 16
i = -1
if CFGKEY.scriptname:
i = 0
Draw.PushButton('help', BEVT_HELP, x, by, bw, bh,
'Show documentation for the script that owns this key (hotkey: H)')
Draw.PushButton('back', BEVT_BACK, x + (1+i)*bw, by, bw, bh,
'Back to config keys selection screen (hotkey: ESC)')
Draw.PushButton('exit', BEVT_EXIT, x + (2+i)*bw, by, bw, bh,
'Exit from Scripts Config Editor (hotkey: Q)')
Draw.PushButton('revert', BEVT_CANCEL, x + (3+i)*bw, by, bw, bh,
'Revert data to original values (hotkey: U)')
Draw.PushButton('apply', BEVT_APPLY, x + (4+i)*bw, by, bw, bh,
'Apply changes, if any (hotkey: ENTER)')
#.........这里部分代码省略.........