Sep 11

Processing rev146 came out a few days ago(since then r148 showed up). Till now, I’ve been using rev135-expert, so it’s about time to upgrade. Since there really weren’t any good new games on the horizon, I dove into revisions.txt(I will marry my procrastination one day). As usual some changes and bugfixes were made.
Here are some of the interesting functions I found there, that haven’t been added to the reference yet:

Dialog boxes
Functions that prompt the user for a file to open, a location to save a file, or select a folder:

String loadPath = selectInput(“What file ya want?”);
String savePath = selectOutput(“Save this masterpiece as…”);
String folderPath = selectFolder(“Which folder has the good stuff?”);

Couldn’t make it work in browser because of

java.security.AccessControlException: access denied

Oh well you can’t have everything. It works in P5 environment and exported application (at least in Windows)

requestImage(filename);
This function load images on a separate thread so that your sketch does not freeze while images load during setup(). While the image is loading, its width and height will be 0. If an error occurs while loading the image, its width and height will be set to -1. You’ll know when the image has loaded properly because its width and height will be > 0.
Wouldn’t it be nice if the height parameter would store the percentage of the loaded data?

PImage.resize(int width, int height)
Allows you to resize a PImage in place. Setting width or height to zero will resize that dimension in proportion to the other.
Keep in mind that this won’t work if called right after requestImage()

textAlign(ALIGN, YALIGN);
Added vertical param fo textAlign for text(str, x, y, w, h)

there’s also
imageMode(CENTER);
so Hasta la Vista for

image(gfx, -gfx.width*0.5, -gfx.height*0.5);

but it doesn’t work for me. Neither in r146 nor r148.

Download source code that uses all of the presented functions

Dec 15

Urkel asked at the Kongregate forums if anyone could help him with the domain lock in AS3. Well I don’t know AS3, as for me it’s still “I’ll dig into it tomorrow”, but with help from Google and Flash Help I’ve modified the first example from Flash Rights’ Domain Control page so that it’s… well, maybe not pure AS3 but compiles as if it were. Anyway maybe someone will use it or will rewrite it so that it fits standards and stuff. For now it works and that’s a start.

Here’s a live swf. It doesn’t lock anything – it just shows domain.

Here’s the fla.

Source:

import flash.events.*;
import flash.display.LoaderInfo;

function enterFrameHandler(event:Event):void {
var url:String=stage.loaderInfo.url; //this is the magic _url successor
var urlStart:Number = url.indexOf(“://”)+3;
var urlEnd:Number = url.indexOf(“/”, urlStart);
var domain:String = url.substring(urlStart, urlEnd);
var LastDot:Number = domain.lastIndexOf(“.”)-1;
var domEnd:Number = domain.lastIndexOf(“.”, LastDot)+1;
domain = domain.substring(domEnd, domain.length);
txt.text=domain;

if (domain != “mywebsite.com”) {
// do nasty things to thief ;)
}
}

addEventListener(Event.ENTER_FRAME, enterFrameHandler);

Sidenote: I need some good AS source formatting wp plugin and sth like lighbox with swf support. Anyone?

Nov 28

This is place, where I’ll be publishing some information about my activity on the field of creation : of game design and graphics. There will be also some humour (not only from the sector), complaining about life or admiration for beauty of the moment. Who said tits?!

Warning! Warning! Great danger! This blog will use bad language (grammar, spelling and what the fuck not). So parents and my English teachers beware: you should not read this.*

*inspired by readme.txt from NaaC

Next Entries »