Functions in this code:
- AddFilter
AddGrid
Brightness
Tent
LargeFilter
The code for the definitions:
- Code: Select all
#define tvlines 0
#define verticallines 1
#define pixelate 2
#define pixelate2 3
#define brighter 0
#define darker 1
#define brighten 0
#define darken 1
#define lighten 0
#define lighter 0
#define red 0
#define green 1
#define blue 2
#define black 3
#define white 4
Place this code in the Global Code.
The next code also goes in global code, this is used to call all of the filters
- Code: Select all
void Brightness(int mode, int ammount)
{
double a;
a = 1 - (double)ammount / 100;
if (mode == 0)
{
r = 255;
g = 255;
b = 255;
}
if (mode == 1)
{
r = 0;
b = 0;
g = 0;
}
erase(r, g, b, a);
}
void AddGrid(int gridsize, int mode)
{
int i;
for (i=0;i<width;i+=gridsize)
{
if (mode == 0)
{
setpen(255, 0, 0, 0, 1);
}
if (mode == 1)
{
setpen(0, 255, 0, 0, 1);
}
if (mode == 2)
{
setpen(0, 0, 255, 0, 1);
}
if (mode == 3)
{
setpen(0, 0, 0, 0, 1);
}
if (mode == 4)
{
setpen(255, 255, 255, 0, 1);
}
moveto(i, 0);
lineto(i, height);
moveto(0, i);
lineto(width, i);
}
}
void AddFilter(int mode)
{
int i;
int height_i;
if (mode == 0)
{
for (i=0;i<width;i+=2)
{
setpen(0, 0, 0, 0, 1);
moveto(0, i);
lineto(width, i);
}
}
if (mode == 1)
{
for (i=0;i<width;i+=2)
{
setpen(0, 0, 0, 0, 1);
moveto(i, 0);
lineto(i, height);
}
}
if (mode == 2)
{
for (i=0;i<width;i+=3)
{
setpen(0, 0, 0, .70, 2);
moveto(i, 0);
lineto(i, height);
moveto(0, i);
lineto(width, i);
}
}
if (mode == 3)
{
for (i=0;i<width;i+=2)
{
setpen(0, 0, 0, .70, 1);
moveto(i, 0);
lineto(i, height);
moveto(0, i);
lineto(width, i);
}
}
}
void Tent(int rr, int gg, int bb)
{
erase(rr, gg, bb, .70);
}
void LargeFilter(int mode)
{
int i;
int height_i;
if (mode == 0)
{
for (i=0;i<width;i+=4)
{
setpen(0, 0, 0, 0, 1);
moveto(0, i);
lineto(width, i);
}
}
if (mode == 1)
{
for (i=0;i<width;i+=4)
{
setpen(0, 0, 0, 0, 1);
moveto(i, 0);
lineto(i, height);
}
}
if (mode == 2)
{
for (i=0;i<width;i+=6)
{
setpen(0, 0, 0, .70, 2);
moveto(i, 0);
lineto(i, height);
moveto(0, i);
lineto(width, i);
}
}
if (mode == 3)
{
for (i=0;i<width;i+=4)
{
setpen(0, 0, 0, .70, 1);
moveto(i, 0);
lineto(i, height);
moveto(0, i);
lineto(width, i);
}
}
}
How to use:
+-=-=-=-=-=-=-=-=-=-=-=How to use-=-=-=-=-=-=-=-=-=-=-=-+
To use these functions, after you've coppied and pasted the code, simply make a canvas, and place your code in the create actor.
Examples:
AddFilter(tvlines);
This function will make TV lines, or horrizontal lines which make games look a bit different on mobile or small screens.
Where tvlines is, you can also put:
- verticallines
pixelate
pixelate2
AddGrid is a bit different, to use this you have to first tell the grid size, 32 will be 32x32 and 16 will be 16x16. Any number you put counts as both width and height of the grid. You also must specify a color from 5 color selections. Those colors are:
- red
green
blue
black
white
Examples:
AddGrid(32, white);
Tenting the screen is as easy as typing in Tent(r, g, b);.
Examples:
Tent(89, 89, 255);
The brightness can control how bright or dark the screen is.
Examples:
Brigtness(lighter, 30);
The lighter means that it'll brighten the screen. To darken the screen, simply put darken. The 30 is how much it gets brighter. You can range this anywhere from 0 to 100.
The commands you can use for Brightness are:
- lighter
lighten
brighter
brighten
darker
darken
LagreFilter is the same as AddFilter but the filters are larger.
Remember to put every one of these inside of CreateActor in a Canvas Actor, or you will probably lag.
Enjoy
SCREENSHOTS:
tvlines:
Notice how it creates horizontal lines that distort the graphics, which can make playing games on a tall screen look better.
verticallines:
Notice how this brings out the text more then it does using tvlines.
Tent:
Notice how it makes a blue tent to the screen.
Grid:
Notice how it makes a grid. This can be usefull for tile editors, or art programs.
Pixelate:
Notice how it brings out the pixels a bit more.
Pixelate2:
This is slightly different then the pixelate, as the pixels are shown smaller. This is usefull for smaller resolution or full screen games, as pixelate gives an allusion in full screen of brighter pixel spots, while pixelate2 doesn't.