Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-08-2011, 08:35 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
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?
Reply With Quote
  #2  
Old 09-08-2011, 08:53 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You can edit the rotation like this:

findimg(200).rotation = pi;
__________________
Quote:
Reply With Quote
  #3  
Old 09-08-2011, 09:04 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
What is the pi?
Reply With Quote
  #4  
Old 09-08-2011, 09:08 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Nvm. I got it. It was obvious lol
Reply With Quote
  #5  
Old 09-08-2011, 12:13 PM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
can you do a horizontal reflection too?
Reply With Quote
  #6  
Old 09-08-2011, 12:48 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by blackbeltben View Post
can you do a horizontal reflection too?
You can mirror images by using negative values for stretchx and/or stretchy.
Reply With Quote
  #7  
Old 12-29-2011, 11:37 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
It seems that rotation uses the center to rotate the entity, is there any way to set the rotation center?
Reply With Quote
  #8  
Old 12-30-2011, 12:32 AM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by Crow View Post
You can mirror images by using negative values for stretchx and/or stretchy.
I learned something new today <3
__________________
Reply With Quote
  #9  
Old 12-30-2011, 01:44 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Pelikano View Post
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
__________________
Reply With Quote
  #10  
Old 12-30-2011, 01:57 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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 
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #11  
Old 12-30-2011, 04:51 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Gunderak View Post
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, ...?
__________________
MEEP!
Reply With Quote
  #12  
Old 12-30-2011, 05:23 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
I think pixels.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #13  
Old 12-30-2011, 05:32 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
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
Reply With Quote
  #14  
Old 12-30-2011, 06:54 AM
Stephen Stephen is offline
Boom!
Stephen's Avatar
Join Date: May 2004
Location: San Francisco
Posts: 10,410
Stephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud of
Tigairius could offer some great solutions on smoothly rotating a static image.
__________________
Reply With Quote
  #15  
Old 12-30-2011, 07:31 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Pelikano View Post
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);
  }

__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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