Hey everyone!
I'm not sure if this is the right section to post this. But, I have made a quick pixel art splash screen for AGS if anyone needs/wants to use it. I've been using it in my my latest game and just felt like I had to share it with the AGS community for being so helpful! Enjoy everyone!
Resolution: 320x240
(https://i.imgur.com/ryVAsnt.png)
I moved this to Critics Lounge.
Depending on whether you want other people's comments on it or not, if not it could be posted in the contribution thread (http://www.adventuregamestudio.co.uk/forums/index.php?topic=14864.0) instead.
Anyway, since it's a blocky pixel art image, is there any reason for it to be that large. It would be much preferable if it's in low resolution (with 1:1 pixels instead of large blocky ones) so people who decide to use it can scale it up to their need whenever necessary.
People can comment if they wish. I just wanted to make something that everyone can use if they want to. What I will do is add the 1:1 scaled image instead of the larger one. I was thinking in reverse, that people could scale down the larger image without distorting the pixels. The design was intended to be simple with block letters simply because I find them easier to draw. Anyone can modify this to their liking if they wish :)
Made an AGS Script module version of this sprite.
splash.ash
// splash module header
import void ShowSplash();
import void HideSplash();
splash.asc
// splash module script
String _DecompressRLE(String rle)
{
String result = "";
int i = 0;
while (i < rle.Length) {
int currentChar = rle.Chars[i];
i++;
// Extract the numeric value (length of repetition)
int k = i;
while (k < rle.Length && rle.Chars[k] >= '0' && rle.Chars[k] <= '9') {
k++;
}
String countStr = rle.Substring(i, k-i);
i = k;
int count = countStr.AsInt;
// Repeat the character and append to result
for (int j = 0; j < count; j++) {
result = result.AppendChar(currentChar);
}
}
return result;
}
DynamicSprite* _CreateAGSSprite(bool tiny)
{
String rlebmp = "w49b3w36b1w5b1w2b1w131b1w3b1w19b1w10b1w4b1w5b1w6b1w2b1w124b1w5b1w1b2w2b3w2b2w3b4w2b3w2b3w4b1w2b1w2b1w1b2w1b4w1b1w124b1w5b2w1b1w1b1w2b1w4b1w4b1w2b1w2b1w1b1w2b1w4b1w2b1w2b1w2b1w3b1w2b3w122b1w5b1w4b4w2b3w4b1w2b4w1b1w2b1w4b1w2b1w2b1w2b1w3b1w2b1w2b1w121b1w3b1w1b1w4b1w4b1w2b1w4b1w2b1w4b1w2b1w4b1w2b1w2b1w2b1w3b1w2b1w2b1w122b3w2b1w5b3w2b4w4b1w2b3w2b3w5b2w1b2w2b3w3b1w1b1w2b1w846e10w4k11w4k5w2k6w3k12w2k11w4k13w2k5w2k6w2k11w5k12w49e10w4k11w4k5w2k6w3k12w2k11w4k13w2k5w2k6w2k13w3k12w48e13w2k13w2k5w2k6w2k13w2k13w2k13w2k5w2k6w2k13w2k13w48e5w2e6w2k5w2k6w2k5w2k6w2k5w10k5w2k6w6k5w6k5w2k6w2k5w2k6w2k5w38a2w16e5w2e6w2k5w2k6w2k5w2k6w2k5w10k5w2k6w6k5w6k5w2k6w2k5w2k6w2k5w33a4w1a2w16e13w2k5w2k6w2k5w2k6w2k9w6k5w2k6w6k5w6k5w2k6w2k11w4k9w24a9w1a2w16e13w2k5w2k6w2k5w2k6w2k9w6k5w2k6w6k5w6k5w2k6w2k11w4k9w20a13w1a2w16e13w2k5w2k6w2k5w2k6w2k9w6k5w2k6w6k5w6k5w2k6w2k11w4k9w16a17w1a2w16e5w2e6w2k5w2k6w2k5w2k6w2k5w10k5w2k6w6k5w6k5w2k6w2k5w2k6w2k5w15a22w1a2w16e5w2e6w2k5w2k6w2k5w2k6w2k5w10k5w2k6w6k5w6k5w2k6w2k5w2k6w2k5w11a26w1a2w16e5w2e6w2k13w2k13w2k13w2k5w2k6w6k5w6k13w2k5w2k6w2k13a1w1a27w1a2w16e5w2e6w2k13w2k13w2k13w2k5w2k6w6k5w6k13w2k5w2k6w2k13a1w1a27w1a2w1a8w7e5w2e6w2k11w4k11w5k12w2k5w2k6w6k5w7k10w4k5w2k6w3k12a1w1a27w1a2w1a9w139a1w1a27w1a2w2a8w139a1w1a27w1a2w6a4w139a1w1a27w1a2w7a3w7e12w3k10w4k19w5k12w67a1w1a27w1a2w7a3w7e12w3k10w4k19w5k12w67a1w1a27w1a2w7a3w6e13w2k13w2k20w3k13w67a1w1a27w1a2w7a3w6e5w10k5w2k6w2k5w2k6w2k5w3k5w75a1w1a27w1a2w7a3w6e5w10k5w2k6w2k5w2k6w2k5w3k5w75a1w1a27w1a2w7a3w6e5w1e7w2k13w2k5w2k6w2k5w3k9w71a1w1a27w1a2w7a3w6e5w1e7w2k13w2k5w2k6w2k5w3k9w71a1w1a27w1a2w7a3w6e5w1e7w2k13w2k5w2k6w2k5w3k9w71a1w1a27w1a2w7a3w6e5w2e6w2k5w2k6w2k5w2k6w2k5w3k5w75a1w1a27w1a2w7a3w6e5w2e6w2k5w2k6w2k5w2k6w2k5w3k5w75a1w1a27w1a2w7a3w6e13w2k5w2k6w2k5w2k6w2k5w3k13w67a1w1a27w1a2w7a3w6e13w2k5w2k6w2k5w2k6w2k5w3k13w67a1w1a27w1a2w7a3w7e12w2k5w2k6w2k5w2k6w2k5w4k12w67a1w1a27w1a2w7a3w139a1w1a27w1a2w7a3w139a1w1a27w1a2w7a3w139a1w1a27w1a2w6a4w7e12w2k13w2k5w2k6w2k11w4k5w4k10w54a1w1a27w1a2w2a8w7e12w2k13w2k5w2k6w2k11w4k5w4k10w54a1w2a26w1a2w1a9w6e13w2k13w2k5w2k6w2k13w2k5w3k13w52a3w4a22w1a2w1a8w7e5w14k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w52a7w4a18w1a2w16e5w14k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w55a8w4a14w1a2w16e11w8k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w59a8w4a10w1a2w16e11w8k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w64a7w4a6w1a2w17e12w6k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w68a7w4a2w1a2w23e6w6k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w72a7w3a2w23e6w6k5w6k5w2k6w2k5w2k6w2k5w3k5w2k6w77a7w16e13w6k5w6k13w2k13w2k5w3k13w81a3w16e13w6k5w6k13w2k13w2k5w3k13w100e11w8k5w7k10w4k11w4k5w4k10w54";
String dtabmp = _DecompressRLE(rlebmp);
int dtabmp_w = 181;
int dtabmp_h = 56;
int cmap[] = new int[128];
cmap['w'] = 65535;
cmap['k'] = 65536;
cmap['b'] = 10565; // gray
cmap['a'] = 25823; // light blue
cmap['e'] = 8629; // blue
DynamicSprite* spr = DynamicSprite.Create(dtabmp_w, dtabmp_h, true);
DrawingSurface* srf = spr.GetDrawingSurface();
for(int i=0; i<10137; i++)
{
int color = cmap[dtabmp.Chars[i]];
srf.DrawingColor = color;
srf.DrawPixel(i % dtabmp_w, i / dtabmp_w);
}
srf.Release();
if(tiny)
{
spr.Crop(0, 10, 60, 46);
return spr;
}
int ox = 320/2 - dtabmp_w/2;
int oy = 180/2 - dtabmp_h/2;
DynamicSprite* spr2 = DynamicSprite.Create(320, 180, true);
DrawingSurface* srf2 = spr2.GetDrawingSurface();
srf2.Clear(65535);
srf2.DrawImage(ox, oy, spr.Graphic);
srf2.Release();
return spr2;
}
void _DrawSplash(DrawingSurface *surface)
{
DynamicSprite* aspr = _CreateAGSSprite(false);
if(aspr.Width > surface.Width || aspr.Height > surface.Height)
{
aspr = _CreateAGSSprite(true);
}
// Calculate integer scaling and preserve aspect ratio
int scaleX = surface.Width / aspr.Width;
int scaleY = surface.Height / aspr.Height;
int scale = scaleY;
if(scaleX < scaleY)
scale = scaleX;
if(scale <= 0)
scale = 1;
int targetWidth = aspr.Width * scale;
int targetHeight = aspr.Height * scale;
if (targetWidth > surface.Width)
{
targetWidth = surface.Width;
targetHeight = (aspr.Height * targetWidth) / surface.Height;
}
if (targetHeight > surface.Height)
{
targetHeight = surface.Height;
targetWidth = (aspr.Width * targetHeight) / surface.Width;
}
int ox = (surface.Width - targetWidth) / 2;
int oy = (surface.Height - targetHeight) / 2;
surface.Clear(65535);
surface.DrawImage(ox, oy, aspr.Graphic, 0, targetWidth, targetHeight);
}
DynamicSprite* _SplashSprite;
Overlay* _SplashOverlay;
void _CreateSplashOverlay()
{
_SplashSprite = DynamicSprite.Create(Screen.Width, Screen.Height, true);
DrawingSurface* surf = _SplashSprite.GetDrawingSurface();
_DrawSplash(surf);
surf.Release();
_SplashOverlay = Overlay.CreateGraphical(0, 0, _SplashSprite.Graphic);
_SplashOverlay.ZOrder = 1000000;
}
void _RemoveSplashOverlay()
{
if(_SplashOverlay != null)
{
_SplashOverlay.Remove();
_SplashOverlay = null;
}
if(_SplashSprite != null)
{
_SplashSprite.Delete();
_SplashSprite = null;
}
}
// public interface
void ShowSplash()
{
_CreateSplashOverlay();
}
void HideSplash()
{
_RemoveSplashOverlay();
}