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 01-31-2012, 03:50 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Need help in changing a images size

i'm trying to make a images size smaller so that i can separate the image i want from the rest of the images.

In case of confusion, i'm trying to separate the image just like you would in gani editor, by changing the sprites width and height, is there any way to do this via script?
Reply With Quote
  #2  
Old 01-31-2012, 04:22 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
All my examples draw your head sprite facing down.

Using findimg, partx, party, partw, parth:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
    
player.x;
    
player.3;
    
image player.head;
    
partx 0;
    
party 32 2;
    
partw 32;
    
parth 32;

    
// If you want to adjust it's zoom factor (play with this variable)
    
zoom 1;
  }

Using showimg and changeimgpart:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
showimg(200player.headplayer.xplayer.3);
  
changeimgpart(20003223232);
  
changeimgzoom(2001); // How to Change Zoom Factor

Using setimgpart for level npcs:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
setimgpart(player.head032 23232);
  
zoom 1// You can just change zoom directly here (GS2 only)

__________________
Quote:
Reply With Quote
  #3  
Old 01-31-2012, 05:36 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Interesting, the wiki labeled partx, y, w, and h as floats, maby that's why it wasn't working when i used it. what part of an image does partw and parth change?


Edit: actually, please tell me how they all work. I'm playing with them and it seems i have no understanding of any of them.

Last edited by khortez; 01-31-2012 at 05:55 AM..
Reply With Quote
  #4  
Old 01-31-2012, 05:55 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
Quote:
Originally Posted by khortez View Post
Interesting, the wiki labeled partx, y, w, and h as floats, maby that's why it wasn't working when i used it. what part of an image does partw and parth change?
width, height.
__________________
Quote:
Reply With Quote
  #5  
Old 01-31-2012, 02:34 PM
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
Just in case other players might get across that question:

Quote:
Originally Posted by khortez View Post
what part of an image does partw and parth change?
partx and party are changing the locations from where the image will be shown. partw and parth are changing the width and height from the image (how big it will appear). So:

PHP Code:
with (findimg(200)) {
  
image "head0.png";
  
partx =  0;  //starting x
  
party 64;  //starting y
  
partw 32;  //width 
  
parth 32;  //height

Will display the head0.png. It will show that image from the image´s x = 0 and the images y = 64 (from there on the front view of the head starts). The width will be 32 aswell as the height. So there will be only the front view of the head displayed

Just explained it that way since you told me once that it helps you better
__________________
MEEP!
Reply With Quote
  #6  
Old 01-31-2012, 03:37 PM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Quote:
Originally Posted by callimuc View Post
Just in case other players might get across that question:



partx and party are changing the locations from where the image will be shown. partw and parth are changing the width and height from the image (how big it will appear). So:

PHP Code:
with (findimg(200)) {
  
image "head0.png";
  
partx =  0;  //starting x
  
party 64;  //starting y
  
partw 32;  //width 
  
parth 32;  //height

Will display the head0.png. It will show that image from the image´s x = 0 and the images y = 64 (from there on the front view of the head starts). The width will be 32 aswell as the height. So there will be only the front view of the head displayed

Just explained it that way since you told me once that it helps you better

Thank you i appreciate it, some others might benefit from this as well later.
Reply With Quote
  #7  
Old 01-31-2012, 06:12 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Never mind my edit, i get it. thanks fowlplay4
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 09:44 PM.


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