Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 131
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Rotate Via Script Maintaining Other DrawMethod Settings?  (Read 413 times)

0 Members and 1 Guest are viewing this topic.

Offline MatMan

  • Hero Member
  • *****
  • Posts: 1320
Rotate Via Script Maintaining Other DrawMethod Settings?
« on: March 19, 2012, 01:26:52 pm »
How can I Rotate a entity without manipulating all other drawmethod settings via script.

The problem I'm having is that I don't know how to get the entities current settings (flip,scale etc..) so that I can just rotate the entity.

Code: [Select]
void entityrotate(void entity, float angle)
{
  //Matman V 0.01
    //setdrawmethod(entity, int flag, int scalex, int scaley, int flipx, int flipy, int shiftx, int alpha, int remap, int fillcolor, int rotate, int fliprotate, int transparencybg, pointer colormap)
    setdrawmethod( entity,
                        1,
                   getentityproperty(entity, "DRAWMETHOD","scalex"),//doesn't work
                   getentityproperty(entity, "DRAWMETHOD","scaley"),
                   getentityproperty(entity, "DRAWMETHOD","flipx"),
                   getentityproperty(entity, "DRAWMETHOD","flipy"),
                   getentityproperty(entity, "DRAWMETHOD","shiftx"),
                   getentityproperty(entity, "DRAWMETHOD","alpha"),
                   getentityproperty(entity, "DRAWMETHOD","remap"),
                   getentityproperty(entity, "DRAWMETHOD","fillcolor"),
                   angle
                    );
  return entity;
}
« Last Edit: March 19, 2012, 01:28:40 pm by MatMan »

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Rotate Via Script Maintaining Other DrawMethod Settings?
« Reply #1 on: March 19, 2012, 02:05:52 pm »
AFAIK there is still no way to get a current drawmethod property (except for the remap and color tables). Just like you'll see in my draw functions, if you need the old value later you're going to have to store it in a variable.

On the plus side, a recent addition does allow changing of drawmethod properties individually:

changedrawmethod({entity}, {property name}, {value})

"alpha,
"amplitude"
"beginsize"
"centerx"
"centery"
"enabled"
"endsize"
"fillcolor"
"flag"
"fliprotate"
"flipx"
"perspective"
"remap"
"reset"
"rotate"
"scalex"
"scaley"
"shiftx"
"table"
"transbg"
"watermode"
"wavelength"
"wavespeed"
"wavetime"
"xrepeat"
"xspan"
"yrepeat"
"yspan"

DC
« Last Edit: March 19, 2012, 02:10:57 pm by Damon Caskey »
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline MatMan

  • Hero Member
  • *****
  • Posts: 1320
Re: Rotate Via Script Maintaining Other DrawMethod Settings?
« Reply #2 on: March 19, 2012, 06:03:37 pm »
Thanx for that, very usefull :)

Another Q. It appears that the attack box doesn't rotate with the image, is it suppose to be like this or is it a Missing feature?

You can see it in this video Here with the fireball (rotated at 45) that angles downward.

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal