Change 'hot spot' of sprite and Drawline thickness

Previous topic - Next topic

fjsantosb

Hi there,

I wonder is there is a way to drawsprite by his center, i mean any way to change the 'hot spot' of the sprite.
I know I can use offsets to draw the sprite where must be, but I wonder is there is any method to change this.

In the other hand i wonder is there is any way to change the thickness of drawline (I would like to draw lines more thickness).

Thanks in advance,

Kig Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

MrTAToad

Would be nice, but the only commands that use a different hotspot are those that rotate a sprite (at which point the centre of the sprite is used).

Kitty Hello


fjsantosb

Hi,

Thanks for the answer, i have found specially interesting the pivot point.

And about thickness of drawline? I am currently using 'X_Line' which can be specify the thick of the line, but i can get same 'effect' using only drawline command?

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

Kitty Hello

you can try glLineWidth (there's an OpenGL wrapper on the forums somewhere)

fjsantosb

Thanks Gernot, i will take a look!

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

kamakazieturtle

Code (glbasic) Select

GETSPRITESIZE Image,ImageSizeX,ImageSizeY
ImageCenterX=ImageX+(ImageSizeX/2)
ImageCenterY=ImageY+(ImageSizeY/2)


This will tell you the images center.

fjsantosb

Hi kamakazieturtle,

I actually use this code to get center of sprite (one time only, when i load the sprites, in the sprites type for speed purposes).
Thanks for sharing.

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

fjsantosb

Hi there,

I finally find the wrapper that Gernot talks me about. The wrapper is:

Code (glbasic) Select

INLINE
#define OGL ::
typedef float           GLfloat;
ENDINLINE

INLINE
} extern "C" { void __stdcall glLineWidth( GLfloat width );; }; namespace __GLBASIC__ {
ENDINLINE
FUNCTION glLineWidth: width
INLINE
OGL glLineWidth(width);
ENDINLINE
ENDFUNCTION


It's works like a charm! But I have a question:

When I compiled it's says 'Warning: Demo mode: This command would require Net or 3D addon'.

I currently have NET addon but not 3D. However it's seems is not in demo mode, cause i can't see the 'demo' image on screen.

Can anyone confirm that with NET addon is enough to compile this?

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

Kitty Hello

oh.
You need the premium for INLINE.

Try this instead:
IMPORT "C" void glLineWidth(float);
and try to use it as if it was an GLBasic command.

fjsantosb

Hi Gernot,

Works like a charm!

Anyway, what is the premium module?

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

Kitty Hello


fjsantosb

Very interesting,

I am currently working on 2 games on 2D, but i will probably buy 3D module in a few moths for the next games (3D time)!

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com