控件模块新增修改显示内容的方法,修复key控件右对齐模式绘制错误,修复主菜单快速开始按钮内容不正确
This commit is contained in:
@@ -103,6 +103,13 @@ local button={
|
|||||||
function button:reset()
|
function button:reset()
|
||||||
self.ATV=0
|
self.ATV=0
|
||||||
end
|
end
|
||||||
|
function button:setObject(obj)
|
||||||
|
if type(obj)=="string"or type(obj)=="number"then
|
||||||
|
self.obj=gc.newText(getFont(self.font),obj)
|
||||||
|
elseif obj then
|
||||||
|
self.obj=obj
|
||||||
|
end
|
||||||
|
end
|
||||||
function button:isAbove(x,y)
|
function button:isAbove(x,y)
|
||||||
local ATV=self.ATV
|
local ATV=self.ATV
|
||||||
return
|
return
|
||||||
@@ -219,6 +226,13 @@ local key={
|
|||||||
function key:reset()
|
function key:reset()
|
||||||
self.ATV=0
|
self.ATV=0
|
||||||
end
|
end
|
||||||
|
function key:setObject(obj)
|
||||||
|
if type(obj)=="string"or type(obj)=="number"then
|
||||||
|
self.obj=gc.newText(getFont(self.font),obj)
|
||||||
|
elseif obj then
|
||||||
|
self.obj=obj
|
||||||
|
end
|
||||||
|
end
|
||||||
function key:isAbove(x,y)
|
function key:isAbove(x,y)
|
||||||
return
|
return
|
||||||
x>self.x and
|
x>self.x and
|
||||||
@@ -256,7 +270,7 @@ function key:draw()
|
|||||||
elseif self.align=="L"then
|
elseif self.align=="L"then
|
||||||
mDraw_Y(self.obj,x+self.edge,y+h*.5)
|
mDraw_Y(self.obj,x+self.edge,y+h*.5)
|
||||||
elseif self.align=="R"then
|
elseif self.align=="R"then
|
||||||
mDraw_Y(self.obj,x+w*.5,y+h*.5)
|
mDraw_Y(self.obj,self.x-self.edge-self.obj:getWidth(),y+h*.5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function key:getInfo()
|
function key:getInfo()
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function scene.sceneInit()
|
|||||||
cmdEntryThread()
|
cmdEntryThread()
|
||||||
|
|
||||||
--Set quick-play-button text
|
--Set quick-play-button text
|
||||||
scene.widgetList[2].text=gc.newText(getFont(scene.widgetList[2].font),text.WidgetText.main.qplay..": "..text.modes[STAT.lastPlay][1])
|
scene.widgetList[2]:setObject(text.WidgetText.main.qplay..": "..text.modes[STAT.lastPlay][1])
|
||||||
quickSure=false
|
quickSure=false
|
||||||
|
|
||||||
--Create demo player
|
--Create demo player
|
||||||
|
|||||||
Reference in New Issue
Block a user