コード例 #1
0
def test_image(console, tmpdir):
    img = libtcodpy.image_new(16, 16)
    libtcodpy.image_clear(img, libtcodpy.Color(0, 0, 0))
    libtcodpy.image_invert(img)
    libtcodpy.image_hflip(img)
    libtcodpy.image_rotate90(img)
    libtcodpy.image_vflip(img)
    libtcodpy.image_scale(img, 24, 24)
    libtcodpy.image_set_key_color(img, libtcodpy.Color(255, 255, 255))
    libtcodpy.image_get_alpha(img, 0, 0)
    libtcodpy.image_is_pixel_transparent(img, 0, 0)
    libtcodpy.image_get_size(img)
    libtcodpy.image_get_pixel(img, 0, 0)
    libtcodpy.image_get_mipmap_pixel(img, 0, 0, 1, 1)
    libtcodpy.image_put_pixel(img, 0, 0, libtcodpy.Color(255, 255, 255))
    libtcodpy.image_blit(img, console, 0, 0, libtcodpy.BKGND_SET, 1, 1, 0)
    libtcodpy.image_blit_rect(img, console, 0, 0, 16, 16, libtcodpy.BKGND_SET)
    libtcodpy.image_blit_2x(img, console, 0, 0)
    libtcodpy.image_save(img, tmpdir.join('test.png').strpath)
    libtcodpy.image_delete(img)

    # Not portable.
    #img = libtcodpy.image_from_console(console)
    #libtcodpy.image_refresh_console(img, console)
    #libtcodpy.image_delete(img)

    libtcodpy.image_delete(libtcodpy.image_load('../data/img/circle.png'))
コード例 #2
0
 def close(self):
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
コード例 #3
0
 def close(self):
     """Clean up lighting assets prior to deleting object"""
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
     self.light_enabled = False
コード例 #4
0
ファイル: interfaces.py プロジェクト: frogbotherer/DalekRL
 def close(self):
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
コード例 #5
0
ファイル: interfaces.py プロジェクト: frogbotherer/DalekRL
 def close(self):
     """Clean up lighting assets prior to deleting object"""
     libtcod.map_delete(self.__tcod_light_map)
     libtcod.image_delete(self.__tcod_light_image)
     self.light_enabled = False
コード例 #6
0
ファイル: gEngine.py プロジェクト: GrishdaFish/Ascension
 def image_delete(self,img):
     i = self.mImages.pop(img-1)
     libtcod.image_delete(i)