@@ -221,12 +221,12 @@ def lower(self, object_data):
221221class MeshMaterial (Material ):
222222
223223 def __init__ (self , color = 0xffffff , reflectivity = 0.5 , map = None ,
224- opacity = 1.0 , ** kwargs ):
224+ transparent = False , ** kwargs ):
225225 super (MeshMaterial , self ).__init__ ()
226226 self .color = color
227227 self .reflectivity = reflectivity
228228 self .map = map
229- self .opacity = opacity
229+ self .transparent = transparent
230230 self .properties = kwargs
231231
232232 def lower (self , object_data ):
@@ -235,7 +235,7 @@ def lower(self, object_data):
235235 u"type" : self ._type ,
236236 u"color" : self .color ,
237237 u"reflectivity" : self .reflectivity ,
238- u"opacity " : self .opacity
238+ u"transparent " : self .transparent
239239 }
240240 data .update (self .properties )
241241 if self .map is not None :
@@ -281,23 +281,24 @@ class CanvasImage(Image):
281281
282282 def __init__ (self , alpha ):
283283 super (CanvasImage , self ).__init__ ()
284- self .alpha = alpha
285284
286285 def lower (self , object_data ):
287286 return {
288287 u"uuid" : self .uuid ,
289- u"url" : u'place_holder' ,
290- u"alpha" : self .alpha
291288 }
292289
293290
294291class TextTexture (Texture ):
295292
296- def __init__ (self , text , font = '96px sans-serif' , width = 200 , height = 100 ,
293+ def __init__ (self , text , font_size = 96 , font_face = 'sans-serif' ,
294+ width = 200 , height = 100 ,
297295 position = [10 , 10 ],alpha = True ):
298296 super (TextTexture , self ).__init__ ()
299297 self .text = text
300- self .font = font
298+ # font_size will be passed to the JS side as is; however if the text
299+ # width exceeds canvas width, font_size will be reduced.
300+ self .font_size = font_size
301+ self .font_face = font_face
301302 self .width = width
302303 self .height = height
303304 self .position = position
@@ -308,7 +309,8 @@ def lower(self, object_data):
308309 u"uuid" : self .uuid ,
309310 u"type" : u"TextTexture" ,
310311 u"text" : unicode (self .text ),
311- u"font" : self .font ,
312+ u"font_size" : self .font_size ,
313+ u"font_face" : self .font_face ,
312314 u"width" : self .width ,
313315 u"height" : self .height ,
314316 u"position" : self .position ,
0 commit comments