2007-11-16 18:25:45 +00:00
|
|
|
-- ASE - Allegro Sprite Editor
|
|
|
|
-- Copyright (C) 2001-2005, 2007 by David A. Capello
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
local function MakeDacap()
|
|
|
|
local x, y, sprite, image, render
|
|
|
|
local w, h = 256, 128
|
|
|
|
|
2007-12-13 15:55:01 +00:00
|
|
|
sprite = NewSprite(IMAGE_RGB, w, h)
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
-- Background layer
|
|
|
|
image = GetImage()
|
|
|
|
image_clear(image, _rgba(255, 255, 255, 255))
|
|
|
|
|
|
|
|
render = RenderText("verdana10.pcx", 22, _rgba(255,0,0,255), "David A. Capello")
|
|
|
|
if render then
|
|
|
|
x = image.w/2-render.w/2+2
|
|
|
|
y = image.h/2-render.h/2+2
|
|
|
|
image_merge(image, render, x, y, 255, BLEND_MODE_NORMAL)
|
|
|
|
ConvolutionMatrixRGB("smooth-3x3")
|
|
|
|
image_free(render)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Foreground layer
|
2007-12-13 15:55:01 +00:00
|
|
|
NewLayer()
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
image = GetImage()
|
|
|
|
image_clear(image, _rgba(0,0,0,0))
|
|
|
|
|
|
|
|
render = RenderText("verdana10.pcx", 22, _rgba(0,0,0,255), "David A. Capello")
|
|
|
|
if render then
|
|
|
|
x = image.w/2-render.w/2
|
|
|
|
y = image.h/2-render.h/2
|
|
|
|
image_merge(image, render, x, y, 255, BLEND_MODE_NORMAL)
|
|
|
|
image_free(render)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- flatten both layers
|
|
|
|
FlattenLayers()
|
|
|
|
|
|
|
|
return sprite
|
|
|
|
end
|
|
|
|
|
|
|
|
local sprite = MakeDacap()
|
|
|
|
if sprite then
|
|
|
|
sprite_quantize(sprite)
|
|
|
|
use_sprite_rgb_map(sprite)
|
|
|
|
sprite_set_imgtype(sprite, IMAGE_INDEXED, DITHERING_NONE)
|
|
|
|
restore_rgb_map()
|
|
|
|
sprite_show(sprite)
|
|
|
|
end
|