How to create the image on a field dialogbox?
Moderators: Víctor Paredes, Belgarath, slowtiger
How to create the image on a field dialogbox?
How to create the image on a field dialogbox?
Re: How to create the image on a field dialogbox?
I assume you are talking about a preview image, such as the star shape shown here:maxic wrote:How to create the image on a field dialogbox?

See the sample scripts lm_star.lua or lm_polygon.lua for details.
As I understand it, you need to add a mesh preview in your dialog definition:
Code: Select all
d.preview = MOHO.MeshPreview(200, 200)
l:AddChild(d.preview)
Code: Select all
function LM_PolygonDialog:UpdatePreview()
local mesh = self.preview:Mesh()
mesh:Clear()
local numPoints = self.numPoints:IntValue()
numPoints = LM.Clamp(numPoints, 3, 20)
LM_Polygon:BuildPolygon(mesh, numPoints)
self.preview:CreateShape(true)
self.preview:Refresh()
end
Code: Select all
self:UpdatePreview()
Thanks, it I too looked in examples
It is necessary BITMAP
- Lost Marble
- Site Admin
- Posts: 2355
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
- Lost Marble
- Site Admin
- Posts: 2355
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact: