当前位置: 首页>>代码示例>>Python>>正文


Python Images.load_imageurl方法代码示例

本文整理汇总了Python中Images.load_imageurl方法的典型用法代码示例。如果您正苦于以下问题:Python Images.load_imageurl方法的具体用法?Python Images.load_imageurl怎么用?Python Images.load_imageurl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Images的用法示例。


在下文中一共展示了Images.load_imageurl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import Images [as 别名]
# 或者: from Images import load_imageurl [as 别名]
 def __init__(self, pos, text, effect, small = False):
     self.pos = pos
     self.text = text
     self.effect = effect
     self.pressed = False
     self.font = Game.get_font()
     if small:
         url_base = "img/gui/button_small"
     else:
         url_base = "img/gui/button"
     self.unpressed_image = Images.load_imageurl(url_base + "_up.png")
     self.hovered_image = Images.load_imageurl(url_base + "_hover.png")
     self.pressed_image = Images.load_imageurl(url_base + "_down.png")
开发者ID:kaikue,项目名称:Oceania,代码行数:15,代码来源:Button.py

示例2: load_images_for

# 需要导入模块: import Images [as 别名]
# 或者: from Images import load_imageurl [as 别名]
 def load_images_for(self, directory):
     img_idle_l = Images.load_imageurl("img/player/" + directory + "/idle.png")
     img_idle_r = Images.flip_horizontal(img_idle_l)
     imgs_idle = (img_idle_l, img_idle_r)
     img_swim_1_l = Images.load_imageurl("img/player/" + directory + "/swim1.png")
     img_swim_1_u = Images.rotate(img_swim_1_l, -90)
     img_swim_1_r = Images.flip_horizontal(img_swim_1_l)
     img_swim_1_d = Images.rotate(img_swim_1_l, 90)
     imgs_swim_1 = (img_swim_1_l, img_swim_1_u, img_swim_1_r, img_swim_1_d)
     img_swim_2_l = Images.load_imageurl("img/player/" + directory + "/swim2.png")
     img_swim_2_u = Images.rotate(img_swim_2_l, -90)
     img_swim_2_r = Images.flip_horizontal(img_swim_2_l)
     img_swim_2_d = Images.rotate(img_swim_2_l, 90)
     imgs_swim_2 = (img_swim_2_l, img_swim_2_u, img_swim_2_r, img_swim_2_d)
     return (imgs_idle, imgs_swim_1, imgs_swim_2)
开发者ID:kaikue,项目名称:Oceania,代码行数:17,代码来源:Player.py

示例3: __init__

# 需要导入模块: import Images [as 别名]
# 或者: from Images import load_imageurl [as 别名]
 def __init__(self, buttons, labels = [], background = False):
     self.mouse_pressed = False
     self.buttons = buttons
     self.labels = labels
     self.background = background
     if background:
         self.background_img = Images.load_imageurl("img/gui/menu_background.png")
开发者ID:kaikue,项目名称:Oceania,代码行数:9,代码来源:Menu.py

示例4: __init__

# 需要导入模块: import Images [as 别名]
# 或者: from Images import load_imageurl [as 别名]
 def __init__(self):
     self.logo_image = Images.load_imageurl("img/title/logo.png")
     self.logo_x = Game.SCREEN_WIDTH / 2 - self.logo_image.get_width() / 2
     self.logo_y = Game.SCREEN_HEIGHT * 1 // 5
     self.back_image = Images.load_imageurl("img/title/back.png")
     self.back_width = self.back_image.get_width()
     self.bg_y = Game.SCREEN_HEIGHT - self.back_image.get_height()
     self.mid_image = Images.load_imageurl("img/title/mid.png")
     self.mid_width = self.mid_image.get_width()
     self.front_image = Images.load_imageurl("img/title/front.png")
     self.front_width = self.front_image.get_width()
     
     self.back_xs = [-self.back_width, 0, self.back_width]
     self.mid_xs = [-self.mid_width, 0, self.mid_width]
     self.front_xs = [-self.front_width, 0, self.front_width]
     
     play_button = Button.Button((Game.SCREEN_WIDTH / 2 - Button.WIDTH / 2, Game.SCREEN_HEIGHT * 8 // 15), "Start Game", "menu")
     if len(Game.get_worlds()) == 0:
         play_button.next_menu = WorldNameMenu(self)
     else:
         play_button.next_menu = WorldSelectMenu(self)
     options_button = Button.Button((Game.SCREEN_WIDTH / 2 - Button.WIDTH / 2, Game.SCREEN_HEIGHT * 10 // 15), "Options", "options")
     quit_button = Button.Button((Game.SCREEN_WIDTH / 2 - Button.WIDTH / 2, Game.SCREEN_HEIGHT * 12 // 15), "Quit", "quit")
     super().__init__([play_button, options_button, quit_button])
开发者ID:kaikue,项目名称:Oceania,代码行数:26,代码来源:MainMenu.py

示例5: load_items

# 需要导入模块: import Images [as 别名]
# 或者: from Images import load_imageurl [as 别名]
def load_items():
    items_file = open("items.json", "r")
    global items
    items = json.load(items_file)
    items_file.close()
    for itemname in items.keys():
        item = items[itemname]
        item["can_place"] = False
        if "class" not in item.keys():
            item["class"] = "ItemStack"
        if isinstance(item["description"], str):
            item["description"] = [item["description"]]
        img = Images.load_imageurl(item["image"])
        
        img_rotated = Images.rotate(img, 90)
        item_images[itemname] = [img,
                                Images.flip_horizontal(img),
                                img_rotated,
                                Images.flip_horizontal(img_rotated),
                                Images.flip_completely(img)]
开发者ID:kaikue,项目名称:Oceania,代码行数:22,代码来源:World.py

示例6: __init__

# 需要导入模块: import Images [as 别名]
# 或者: from Images import load_imageurl [as 别名]
 def __init__(self, imageurl):
     self.img = Images.load_imageurl(imageurl)
     self.width = self.img.get_width()
     self.height = self.img.get_height()
开发者ID:kaikue,项目名称:Oceania,代码行数:6,代码来源:GUI.py


注:本文中的Images.load_imageurl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。