(Unofficial) VERGE User Interface API
Displaying 1-14 of 14 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
creek23

everyone in the community, hello!

I just want to show something that Im proud of -- its an API for User Interface.

--> it only have a Button Class for now.
___--> set/get width;
___--> set/get height;
___--> set/get caption;
___--> set/get enabled;
___--> can be coded when clicked (sample in the demo)
___--> can be clicked with left/right mouse button

--> it would be helpful for game menus.
--> it is in early stage of development.

I submitted a demo game implementing the API's Button Class (?).
here is the updated one.

i would also like to take this chance to ask lord Vecna if He could possibly add a 'scalable' AplhaBlit() function on VERGE -- such a small request but a tremendious work for Him? I really need a 'scalable' AplhaBlit() for this API that Im doing...

also, I'd like to thank all who tried to download the demo. I hope it would be useful for your games.

Posted on 2005-10-15 22:42:48 (last edited on 2005-11-11 03:21:52)

Jesse

You could first scale, then alpha-blit your image (and its mask) if you wanted a scalable alpha blit. It's not very pretty or fast, but it would work.

Posted on 2005-10-16 12:17:28

pthaloearth

I made a function you may find helpful, if used just note me in the code and readme. Thanks and hope it helps. (not overly fast but it does the job.)


void alphaScaleBlit(int x,int y,int xScale,int yScale,int sourceImage,int maskImage,int fade,int destination)
{
int _mask=NewImage(xScale,yScale);
int source=NewImage(xScale,yScale);
ScaleBlit(0,0,xScale,yScale,maskImage,_mask);
ScaleBlit(0,0,xScale,yScale,sourceImage,source);
setlucent(fade);
rectfill(0,0,xScale,yScale,RGB(0,0,0),_mask);
setlucent(0);
AlphaBlit(x,y,source,_mask,destination);
FreeImage(_mask);
FreeImage(source);
}

Posted on 2005-10-16 20:23:18

creek23

ei pthaloearth,

I've edited your code, to something like this;

void VUIAlphaScaleBlit(int xScale,int yScale,int sourceImage,int maskImage,int fade,int destination)
{
int _mask=NewImage(xScale,yScale);
int source=NewImage(xScale,yScale);
ScaleBlit(0,0,xScale,yScale,maskImage,_mask);
ScaleBlit(0,0,xScale,yScale,sourceImage,source);
setlucent(fade);
rectfill(0,0,xScale,yScale,RGB(0,0,0),_mask);
setlucent(0);
AlphaBlit(0,0,source,_mask,destination);
FreeImage(_mask);
FreeImage(source);
}


and tried to call the function once.

in my loop I just 'blit' the value returned by the 'destination' to make it run faster. but it doesnt make do the alpha anymore.

do you think you could debug this one? yours do make it slow and crashes verge when runned for a few seconds -- it uses all my RAM.

Posted on 2005-10-18 05:17:39

pthaloearth

It could be that you called fade backwards, it works the same as setlucent.

EDIT: destination really should just be 'screen' unless you want to doubble buffer or something, which of course will horridly slow this function even more and could have caused the RAM overusage.

As to making it run faster you could remove the

setlucent(fade);
rectfill(0,0,xScale,yScale,RGB(0,0,0),_mask);
setlucent(0);

bit (and thusly the int fade) as that's not really needed unless you'd like it to fade away. If you want an example of it download my bounce and scale digits demo.

As to it crashing your computer I'm rather suprised as I have the 2nd slowest computer out of everyone that has run VergeMark (last i checked) and it runs fine...

This could help as well but you probably understand it already: (taken directly from the readme for the bounce and scale digits demo)

---------------------------------------------------------------------------------------------------------------
-void alphaScaleBlit(int x,int y,int xScale,int yScale,int sourceImage,int maskImage,int fade,int destination)-
---------------------------------------------------------------------------------------------------------------
int x starting x axis point (the image will display to the right of this point)
int y starting y axis point (the image will display below this point)
int xScale ammount to scale the images x axis (no smaller than zero)
int yScale ammount to scale the images y axis (no smaller than zero)
int sourceImage image to perform the scale and alpha blending to
int maskImage the alpha mask image
int fade allows an alpha image to appear to fade (works much like setlucent())
int destination Area in which you wish the image to appear

scale and blit an image with alpha transparency.
Works in much the same way as ScaleBlit except
you must also supply the alpha mask image in order
for it to function properly. This was mainly created
as an internal function however I felt that someone
may find it useful for other things thus I am listing it
in the documentation.

EX:
int image = LoadImage('example.png');
int image_alphaMask = LoadImage('example_alpha.png');
alphaScaleBlit(0,0,100,100,image,image_alphaMask,screen);
freeImage(image);
freeImage(image_alphaMask);


It would help if you showed us the code with the loop and everything, that way we could all know what exactally is being called and such. Hope this helps, and if not please ask more.

Posted on 2005-10-18 13:57:21 (last edited on 2005-10-18 14:03:13)

Overkill

Quote:
Originally posted by pthaloearth


As to it crashing your computer I'm rather suprised as I have the 2nd slowest computer out of everyone that has run VergeMark (last i checked) and it runs fine...

That sexy top score would belong to yours truly. :D

Also, I've been working on my own widget library. It's got buttons, sliders, basically fully functional text fields (copy/paste even to or from external applications, selections), check boxes, radio buttons, text labels and canvases (which you can draw to!). Perhaps I'll upload a demonstration of it soon.

Posted on 2005-10-19 18:38:46 (last edited on 2005-10-19 18:41:43)

creek23

Quote:
Originally posted by pthaloearthAs to it crashing your computer I'm rather suprised as I have the 2nd slowest computer out of everyone that has run VergeMark (last i checked) and it runs fine...


ei! im on a commercial computer shop and your function doesn't make VERGE crash. I tried your suggestion to remove the 'lucent' thing and good thing it runned smoothly on my computer.

thanks for the function, I'll be proud to put you in the credits...

Posted on 2005-10-20 03:12:43

pthaloearth

glad I could help and that you've found my stuff usefull. Happy coding!

Posted on 2005-10-20 13:16:03

creek23

Our semestral break just got over. I was too lazy to get a sideline/part time job. What I did is to futher develop the VERGE User Interface API project that I wrote.

I submitted a better demonstration game using the API. It is in here.

Please react. (voilently will do) :)

Posted on 2005-11-10 20:40:15

resident

Impressive. Inferno alone is cool (though it badly needs some music and sound effects), but the UI, while ugly as sin, is supremely functional.

Posted on 2005-11-11 02:39:16

creek23

Inferno is designed tobe a demo game for VUI API implementation. But it actually is my own VB game. The idea of Inferno was inspired by Warcraft (the RPG maps of WC3).

The VERGE Inferno is my first project to be ported from VB to V3.

As much as possible, I'd like to make all resources used by Inferno to be original. Do you think you could help me with it? I got plans on developing Inferno more than what it is now. But I still have other project all lined up.

Well, I just hope you enjoyed playing Inferno. Try to finish "Fire Checkers" it's quite challenging.

Posted on 2005-11-11 03:17:36

creek23

I know we're close but would it be possible for you to compose an original music for my game Inferno. The music is something ethnic-like, with tribal drums booming and horns whooming.

Please?

Posted on 2005-11-16 00:24:13

basil

I enjoyed the fact that I lead the green army.
Nice work on the button shenanigans. I trust you will continue to work on Inferno? (a question posed in the style of an order)

Posted on 2005-11-16 04:04:06

creek23

Well, you were great coding 3D in VERGE... this is just my simple way saying... Wow! ^^

Posted on 2005-11-24 03:30:39


Displaying 1-14 of 14 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.