Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Rotating images (https://forums.graalonline.com/forums/showthread.php?t=134264507)

greggiles 09-08-2011 08:35 AM

Rotating images
 
When you draw an image, such as a simple hud img, or whater, is it possible to rotate the image? If so, how?

fowlplay4 09-08-2011 08:53 AM

You can edit the rotation like this:

findimg(200).rotation = pi;

greggiles 09-08-2011 09:04 AM

What is the pi?

greggiles 09-08-2011 09:08 AM

Nvm. I got it. It was obvious lol

blackbeltben 09-08-2011 12:13 PM

can you do a horizontal reflection too?

Crow 09-08-2011 12:48 PM

Quote:

Originally Posted by blackbeltben (Post 1667442)
can you do a horizontal reflection too?

You can mirror images by using negative values for stretchx and/or stretchy.

Pelikano 12-29-2011 11:37 PM

It seems that rotation uses the center to rotate the entity, is there any way to set the rotation center?

Emera 12-30-2011 12:32 AM

Quote:

Originally Posted by Crow (Post 1667446)
You can mirror images by using negative values for stretchx and/or stretchy.

I learned something new today <3

cbk1994 12-30-2011 01:44 AM

Quote:

Originally Posted by Pelikano (Post 1679973)
It seems that rotation uses the center to rotate the entity, is there any way to set the rotation center?

Never used it but try
PHP Code:

TShowImg.rotationcenter string the current rotation center (only works when useowncenter=true


Gunderak 12-30-2011 01:57 AM

I have used that and it works, put something like this.
PHP Code:

useowncenter true;
rotationcentre 2,2;
//It might be rotationcentre = { 2, 2 }; so try both ways 


callimuc 12-30-2011 04:51 AM

Quote:

Originally Posted by Gunderak (Post 1680006)
I have used that and it works, put something like this.
PHP Code:

useowncenter true;
rotationcentre 2,2;
//It might be rotationcentre = { 2, 2 }; so try both ways 


Are the numbers counted in tiles, pixel, ...?

Gunderak 12-30-2011 05:23 AM

I think pixels.

Pelikano 12-30-2011 05:32 AM

Hmm couldn't get this working, can I see where you are using this Gunderak?

I can't find rotationcenter or rotationcentre on the graal wiki anyway... hmm

Stephen 12-30-2011 06:54 AM

Tigairius could offer some great solutions on smoothly rotating a static image.

cbk1994 12-30-2011 07:31 AM

Quote:

Originally Posted by Pelikano (Post 1680030)
Hmm couldn't get this working, can I see where you are using this Gunderak?

I can't find rotationcenter or rotationcentre on the graal wiki anyway... hmm

This is working for me:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
with (findImg(200)) {
    
image "light3.png";
    
    
GraalControl.width 2;
    
GraalControl.height 2;
    
    
layer 4;
    
    
// these two lines are the key:
    
useOwnCenter true;
    
rotationCenter = {2020};
  }
  
  while (
true) {
    
findImg(200).rotation += 0.1;
    
sleep(0.05);
  }



Gunderak 12-30-2011 07:45 AM

Wow someone neg repped me for "obviously obvious".
The graal community these days... ._.
I was just trying to help.

Gunderak 12-30-2011 11:36 AM

You're tears feed me - Secret h8r?
O_o
That wasn't tears, I was simply stating that some people are pathetic.
You obviously need to grow up.
I wish Stefan would allow showing who reps.

Gunderak 12-30-2011 02:50 PM

@cbk I wasn't really taking this thread off topic -.-
Woo now I have bad rep because of pathetic children.
I might just quit this forum, too many childish decisions made.

Just to clarify.
+ REP
When a user posts a helpful comment or just try's to help in general.

- REP
When a user posts a useless post that doesn't help at all.

Just clarifying it so that maybe some of you users will understand in the near future.

Emera 12-30-2011 03:08 PM

Quote:

Originally Posted by Gunderak (Post 1680043)
Wow someone neg repped me for "obviously obvious".
The graal community these days... ._.
I was just trying to help.

Quote:

Originally Posted by Gunderak (Post 1680057)
You're tears feed me - Secret h8r?
O_o
That wasn't tears, I was simply stating that some people are pathetic.
You obviously need to grow up.
I wish Stefan would allow showing who reps.

Quote:

Originally Posted by Gunderak (Post 1680068)
@cbk I wasn't really taking this thread off topic -.-
Woo now I have bad rep because of pathetic children.
I might just quit this forum, too many childish decisions made.

Just to clarify.
+ REP
When a user posts a helpful comment or just try's to help in general.

- REP
When a user posts a useless post that doesn't help at all.

Just clarifying it so that maybe some of you users will understand in the near future.

TRIPLE POST :o

Crow 12-30-2011 03:58 PM

Quote:

Originally Posted by Emera (Post 1680069)
TRIPLE POST :o

Man, that'll probably get him some negative reputation.

Pelikano 12-30-2011 04:09 PM

Quote:

Originally Posted by cbk1994 (Post 1680040)
This is working for me:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
with (findImg(200)) {
    
image "light3.png";
    
    
GraalControl.width 2;
    
GraalControl.height 2;
    
    
layer 4;
    
    
// these two lines are the key:
    
useOwnCenter true;
    
rotationCenter = {2020};
  }
  
  while (
true) {
    
findImg(200).rotation += 0.1;
    
sleep(0.05);
  }



Thanks, my problem was that I didn't use showimg.rotationCenter inside GuiShowImgCtrl

Gunderak 12-30-2011 05:07 PM

I really don't care anymore.
I still have the fact that I haven't sunken to their level.


All times are GMT +2. The time now is 05:01 PM.

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