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


Python Images.flip_horizontal方法代码示例

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


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

示例1: load_images_for

# 需要导入模块: import Images [as 别名]
# 或者: from Images import flip_horizontal [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

示例2: load_items

# 需要导入模块: import Images [as 别名]
# 或者: from Images import flip_horizontal [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


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