JazzJackrabbit Community Forums

JazzJackrabbit Community Forums (http://www.jazz2online.com/jcf/index.php)
-   JCS & Scripting (http://www.jazz2online.com/jcf/forumdisplay.php?f=5)
-   -   TrueColor library for AngelScript (http://www.jazz2online.com/jcf/showthread.php?t=19969)

Violet CLM Mar 13, 2016 11:33 PM

TrueColor library for AngelScript
 

Download

I wrote a library that lets you draw sprites using colors that aren't present in the level palette, runnable in the currently released version of JJ2+. It basically recreates much of the jjPIXELMAP, jjANIMFRAME, and jjDraw* code but with a special trick to get around the palette limitations. Even if you don't care about colors, if you're really not a python user, you might like that it reads graphics from .bmp files instead of custom .j2a files.

A sample script, beach2.j2as, is provided that makes the Fish enemies use the piranha sprites from Spelunky HD.

To use, write
Code:

#include "TrueColor.asc"
in your script file and then use some portion of the API, which is all described in the opening comment of truecolor.asc. Alternatively, look through beach2.j2as and copy+paste mercilessly until you've got everything working.

Further updates may or may not occur, but I didn't feel this was ready for a J2O upload just yet.

PurpleJazz Mar 15, 2016 03:32 AM

Massive props! Indeed, the fact that bitmap images can be used as opposed to .j2a files is a huge convenience even if you are already able to use python. I feel like experimenting with this - I'm sure there's some awesome possibilities here and there.

Violet CLM Feb 19, 2017 04:13 PM

TrueColor v1.1 is out.
  • TrueColor images are drawn at 50% opacity if jjANIMFRAMES::transparent is true for the first animframe in an image. (New property bool TrueColor::Coordinates::transparent is added for setting this.)
  • New function TrueColor::EnableCaching automates the process of regenerating all the animframes every time the palette is changed. (beach2.j2as has been updated to show how much easier this is than doing it by hand.)
  • Two new constructors for TrueColor::Bitmap, including one from jjSTREAM, plus a swizzle method to save time.
  • If the filename passed to the TrueColor::Bitmap string constructor already ends in ".bmp" (case insensitive) then ".bmp" will not be added to it.
  • Fixed bug of TrueColor::Coordinates' hotspot/coldspot/gunspot properties not being applied by TrueColor::Bitmap::saveToAnimFrames, only by TrueColor::AllocateSpriteSheet.
  • The width and height properties of TrueColor::Bitmap are now read-only, which is technically not backwards compatible but those were not properties you had any business editing so hopefully that won't be a problem.

Violet CLM Feb 8, 2018 06:15 PM

TrueColor has been uploaded to J2O after holding off on it for two years. It's now version 1.2 and fixes a major bug from previous versions impacting color gradation, plus it supports swinging vines.

Violet CLM May 3, 2019 05:12 PM

TrueColor v1.3 is out. You can now open and manipulate PNG files, giving you full control over the alpha channel: every pixel in a sprite may have any red, green, blue, and alpha value, independent from every other pixel.

Here's another example showing some crabs with antialiasing.

DennisKainz May 30, 2019 08:58 AM

This... Is... AWESOME!!!
Could this feature be theoretically used to create 16bit color "tilesets" by using sprites as tiles? That would be REALLY awesome!

Violet CLM May 30, 2019 08:01 PM

Yeah sure. FPS could be an issue, but sure you could draw sprites and pretend they were tiles if you wanted to.


All times are GMT -8. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
JCF © 2001-Infinity Jazz2Online