本文整理汇总了Python中kivy.core.image.Image.uvsize方法的典型用法代码示例。如果您正苦于以下问题:Python Image.uvsize方法的具体用法?Python Image.uvsize怎么用?Python Image.uvsize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.core.image.Image
的用法示例。
在下文中一共展示了Image.uvsize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def __init__(self, *args, **kw):
super(RootWidget, self).__init__(*args, **kw)
texture = Image('wood.png').texture
texture.wrap = 'repeat'
texture.uvsize = (8, 8)
with self.canvas:
Rectangle(size=(2048, 2048), texture=texture)
示例2: getTexture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def getTexture(self,name, size):
filename = join('art', name+'.png')
texture = Image(filename).texture
texture.wrap = 'repeat'
texture.uvsize = size
self.logger.info(filename)
return texture
示例3: __init__
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def __init__(self, *args, **kwargs) :
super(ScreenNexus, self).__init__(*args, **kwargs)
texture = Image(os.path.join("res", "tile.png")).texture # Create background texture
texture.wrap = "repeat"
texture.uvsize = (12, 24)
with self.canvas.before : # Draw background
Color(1, 1, 1)
Rectangle(texture = texture, size = (Window.width, Window.height), pos = self.pos)
示例4: grass_background
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def grass_background(widget):
bg_texture = Image('resources/grass/grass-texture.png', nocache=True).texture
# get POT texture
#bg_texture = bg_texture.get_region(0, 0, 64, 64)
#bg_texture.uvpos = (0, 0)
bg_texture.uvsize = (35, 35)
bg_texture.wrap = 'repeat'
# fill all the background
with widget.canvas.before:
Rectangle(pos=(0, 0), size=(2560, 2560), texture=bg_texture)
示例5: set_background
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def set_background(self):
texture = Image('resources/interface/modal-background.png').texture
texture.wrap = 'repeat'
texture.uvsize = (2, 1)
with self.canvas.before:
Rectangle(texture=texture, size=self.size, pos=self.pos)
示例6: getTexture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def getTexture(name, size):
filename = join('art', name+'.png')
texture = Image(filename).texture
texture.wrap = 'repeat'
texture.uvsize = size
return texture
示例7: getTexture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import uvsize [as 别名]
def getTexture(name, size=(CELL_SIZE, CELL_SIZE)):
filename = spritePath.format(name)
texture = Image(filename).texture
texture.wrap = 'repeat'
texture.uvsize = size
return texture