Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Bending Gfx (https://forums.graalonline.com/forums/showthread.php?t=65588)

Angel_Light 04-22-2006 09:49 PM

Bending Gfx
 
Is there anyway to bend gfx? I mean like tiles in the level. If you ever played Metroid Prime 2 and used the Annihiltor Beam at full power, thats what I mean. Is there way?

Angel_Light 04-26-2006 01:19 PM

Does anyone have any advice?

Raeiphon 04-26-2006 03:54 PM

I know what you mean, and i'm entirely sure that the Graal engine lacks the graphical support for that sort of thing.

Angel_Light 04-26-2006 10:18 PM

ok thanks

Tyhm 04-29-2006 09:32 PM

/yet/.
If there were a way to read the RGBA of a single point, there would be a way to display it offset with the emitter...

Angel_Light 04-29-2006 10:07 PM

there is no way.. I think you might be able to change the RGBA but not read it

ZeLpH_MyStiK 04-30-2006 02:59 AM

i'm not sure if we're talking about the same thing but you can showimgs and use changeimgpart to show every pixel of that image and then take it from there.

Warcaptain 04-30-2006 03:16 AM

Graal has the graphical potential, just Torque doesnt have it built in.

Angel_Light 04-30-2006 04:02 AM

Wait I just though of something. On GK they can bend the terrain and stuff. Can we just do that to gfxs? I suppose so since a tileset is a gfx, But, how?

ZeLpH_MyStiK 04-30-2006 04:09 AM

Quote:

Originally Posted by Angel_Light
Wait I just though of something. On GK they can bend the terrain and stuff. Can we just do that to gfxs? I suppose so since a tileset is a gfx, But, how?

It's not bending the terrain, it's adding another dimension to it. It's supposed to be 3D-ish using the z-axis, but in this case Graal z is like another y. =\

Angel_Light 04-30-2006 04:30 AM

oh... hmm... :/

Tyhm 04-30-2006 09:35 AM

Altering the Z of a portion of an image is no different than bending an image around that portion, really...but I doubt we'd see that.

ZeLpH_MyStiK 04-30-2006 11:37 PM

Edit: Didn't see this in the GS2 forums, so the script is in GS1. But it can be easily converted using the same idea.

Alright, this is an extremely poor method of creating this illusion, but I created a simple script in demonstrating it. There could be errors as I made this in about 5 minutes, but here goes anyways:
PHP Code:

//#CLIENTSIDE
if (created) {
  
this.offset_x 1;  // offsets the image 16 pixels to the right so the mouse doesn't block it
  
this.offset_y 1;  // offsets 16 pixels down for the same reason
  
this.width imgwidth(block.png);  // the width of the image i'm using block.png
  
setarray this.offset_z,this.width;  // controls the z-coor of each row of pixels
  
setarray this.offset_zmode,this.width;  // controls whether the z-coors should go up or down
  
for(this.i=0this.i<32this.i++) this.offset_z[this.i] = this.i;  // sets the starting positions
  
timeout .05;  // begins the timeout for showimgs
}
if (
timeout) {
  for(
this.i=0this.i<32this.i++) {  // loops thru each pixel row of the image
    
for(this.j=0this.j<32this.j++) {  // loops thru the pixel columns
      
showimg2 200 this.32 this.j,block.png,this.offset_x mousex this.16,this.offset_y mousey this.16,this.offset_z[this.i] / 16;  // shows every pixels of the image at its original location with the exception of the z-coors which are decided by the arrays
      
changeimgpart 200 this.32 this.j,this.i,this.j,1,1;  // shows a pixel as opposed to the entire image
    
}
  }
  for(
this.i=0this.i<32this.i++) {
    if (
this.offset_zmode[this.i] == 0) {  // if the pixel is moving upwards
      
if (this.offset_z[this.i] + == 32) {  // if the pixel reaches the top
        
this.offset_zmode[this.i] = 1;  // changes mode
      
}else this.offset_z[this.i]++;  // otherwise continue upwards movement
    
}else{  // if the pixels are moving downwards
      
if (this.offset_z[this.i] - == 16) {  // as the pixels reach halfway down
        
this.offset_zmode[this.i] = 0;  // change modes
      
}else this.offset_z[this.i]--;  // otherwise continue downwards movement
    
}
  }
  
timeout .05;  // continues loop


Once again very poor method. Also this will lag with giant images.

Admins 04-30-2006 11:52 PM

Screenshot?

Yen 05-01-2006 01:02 AM

There's a stretchx and stretchy variable; it stretches the image like the zoom variable does, but only on one axis.
I'm not sure, but I don't see why you wouldn't be able to stretch an image and then rotate it. You could make, for example, a lightning effect this way. Stretch the lightning image to be the distance from one player to the other, then rotate it so that it goes in the direction of the other player.

I've used stretchx and stretchy to make some nice effects. :)


All times are GMT +2. The time now is 10:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.