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);
  }




All times are GMT +2. The time now is 04:51 PM.

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