本文整理汇总了Python中kivy.core.image.Image.wrap方法的典型用法代码示例。如果您正苦于以下问题:Python Image.wrap方法的具体用法?Python Image.wrap怎么用?Python Image.wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.core.image.Image
的用法示例。
在下文中一共展示了Image.wrap方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_texture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [as 别名]
def set_texture(self,path):
#from kivy.core.image import Image
tex = Image(path).texture
tex.wrap = 'repeat'
self.texture_sidebar = tex
#tex = Image('style/1.png').texture
if tex is not None:
tex.wrap = 'repeat'
self.texture = tex
示例2: __init__
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [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)
示例3: getTexture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [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
示例4: __init__
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [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)
示例5: grass_background
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [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)
示例6: __init__
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [as 别名]
def __init__(self, **kw):
super(HelicopterGame, self).__init__(**kw)
with self.canvas.before:
texture = CoreImage('Images/background.png').texture
texture.wrap = 'repeat'
self.scroll_back = Rectangle(texture=texture, size=self.size, pos=self.pos)
self.line=BezierLine()
Clock.schedule_interval(self.update, 0)
示例7: init_game
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [as 别名]
def init_game(self):
is_start = False
# bring stage
self.bring_stage()
self.character.velocity = [self.block_size / self.speed_ratio, 0]
# map init
with self.background_widget.canvas:
texture = CoreImage('data/blue_land.png').texture
texture.wrap = 'repeat'
self.rect_1 = Rectangle(
texture=texture, size=self.size, pos=self.pos)
self.character_pos_init()
self.init_stage()
示例8: load_tileable
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [as 别名]
def load_tileable(self, name):
t = Image('images/{}.png'.format(name)).texture
t.wrap = 'repeat'
setattr(self, 'tx_{}'.format(name), t)
示例9: load_tileable
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [as 别名]
def load_tileable(self, name):
t = Image('%s.png' % name).texture
t.wrap = 'repeat'
setattr(self, 'tx_%s' % name, t)
示例10: set_background
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [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)
示例11: getTexture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [as 别名]
def getTexture(name, size):
filename = join('art', name+'.png')
texture = Image(filename).texture
texture.wrap = 'repeat'
texture.uvsize = size
return texture
示例12: getTexture
# 需要导入模块: from kivy.core.image import Image [as 别名]
# 或者: from kivy.core.image.Image import wrap [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