Pixilang
From Wikipedia, the free encyclopedia
Pixilang — pixel-oriented programming language
Pixilang is a result of joint brainstorm of outumn 2006 :) Simple programming language for small graphics applications. It was created (by Alex Zolotov (NightRadio) [1] and Mik Razuvaev (Goglus)) specially for non-programmers, demosceners and designers. Any pixilang programs are keeps in a TXT-files, so you can edit it in your lovely text-editor. Pixilang interpreter works in the Windows, Linux and PalmOS at the moment. And it is fully open source (GNU GPL) project.
Contents |
[edit] Features
- crossplatform working;
- easy syntax and small amount of commands;
- universal containers (pixi) using for text/gfx storage;
- pixel graphics describing in a source TXT-files directly (using ASCII symbols);
- transparency (simple and with alpha-channel);
- simple commands for rotation and resize;
- no floating point math operations - only 32bit integers are using;
- playing music in MOD and XM formats (using PsyTexx engine);
- loading GIF (animated) and JPG file formats;
- realtime export to GIF;
[edit] Technical details
Pixilang - interpreter with byte-code generation. Source TXT-file can be loaded from boot.txt (if it exist) automatically or manually by user.
Base thing in the Pixilang is a pixi-container. Pixi-container can contain text-string, image, link to alpha-channel pixi-container, numeric array. You can use different pixi-containers as simple arrays. Remember, that in Pixilang "image", "text-string", "numeric array" are ID-numbers: image - ID-number of pixi-container with image; text-string - ID-number of pixi-container with text-string; numeric array - ID-number of pixi-container with numeric array. Example:
//How to access a second pixel in some image? pixel_value = some_image[ 2 ]
[edit] Getting started. Your first program
Open your lovely text editor and create new file with following content:
//Simple anim example //Save color #003050 to variable o o = #003050 //Describe animated image (pixi): logo = " .o...ooo...o. ..o..o.o..o.. ...ooooooo... ...ooooooo... .ooooooooooo. .o.ooooooo.o. oo.........oo + .o...ooo...o. ..o..o.o..o.. ...ooo.ooo... ...ooooooo... .ooooooooooo. .o.ooooooo.o. oo.........oo " //Convert this image from text form to graphics: make_pixi( logo ) //Set variable with zoom factor: zm = 20 start: transp( 64 ) //Set transparency 64 clear( #FFFFFF ) //Clear screen transp( 256 ) //Set transparency 256 pixi( logo, 0, 0, zm ) //Draw image "logo" with coordinates 0,0 and zoom factor "zm" zm - 1 //Decrement zoom factor frame( 100 ) //Redraw screen and wait 100 milliseconds go start //Go to start
Now run pixilang and select created TXT file.
[edit] To do
- more pixel correction while image transformations;
- music and sound creation unsing pixi-containers;
- working with a custom binary files;
- loop operators;
- 3D pixels.