本文整理汇总了Python中texture.Texture.from_file方法的典型用法代码示例。如果您正苦于以下问题:Python Texture.from_file方法的具体用法?Python Texture.from_file怎么用?Python Texture.from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类texture.Texture
的用法示例。
在下文中一共展示了Texture.from_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sprite
# 需要导入模块: from texture import Texture [as 别名]
# 或者: from texture.Texture import from_file [as 别名]
def sprite(self, filename):
print " -- initializing point sprite {}".format(filename)
self._sprite_texture = Texture.from_file(filename)
示例2: sprite
# 需要导入模块: from texture import Texture [as 别名]
# 或者: from texture.Texture import from_file [as 别名]
def sprite(self, filename):
''' Enable or disable point sprite rendering.
If filename is not None a texture object will be created from the
filename and point sprites will be used when rendering. If filename is
None point sprite rendering will be disabled.
filename -- path to point sprite texture (or None to disable sprites)
'''
if filename:
#debug(msg='initializing point sprite').add('filename', filename).flush()
self._sprite_texture = Texture.from_file(filename)
else:
#debug(msg='point sprite rendering disabled').flush()
self._sprite_texture = None