Graal Forums

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

haunter 12-04-2003 06:28 AM

cropping zoomed images
 
Hmm, I'm having a problem, I hope I can explain it well... Ok, here goes.

If I have an image of, for example, 16*16 pixels, then I want to do a setzoomeffect of... 3... Ok, So i've done that, and now I should have an image of 48*48 pixels. (Unless my math is just THAT horrible). Ok. Now, what if I do a
NPC Code:

setimgpart img,0,0,48,32;



Well... Nothing...

I've tried this useing showimgs as well,

NPC Code:

if (created) {
showimg 143,setimgpart black.png,x,y;
changeimgzoom 143,10;
changeimgpart black.png,x+32,y,32,32;
}



Will this not work? Or am I just really horrible at scripting? :(

tlf288 12-04-2003 07:12 AM

your script syntax is way off.

edit:

your a level maker so here ya go:
NPC Code:

if (created) {
showimg 143, block.png, x, y;
changeimgpart 143, 0, 0, 16, 16;
changeimgzoom 143, 1;
}


haunter 12-05-2003 12:36 AM

Quote:

Originally posted by tlf288
your script syntax is way off.

edit:

your a level maker so here ya go:
NPC Code:

if (created) {
showimg 143, block.png, x, y;
changeimgpart 143, 0, 0, 16, 16;
changeimgzoom 143, 1;
}


Oh right, I put the image name in changeimgzoom rather than the index...

And put setimgpart in the filename for showimg... Wtf 0.o; Eh, I guess I just made foolish mistakes while rushing to test this... Sorry to take up your time ;P

tlf288 12-05-2003 03:29 AM

i am used to working with level makers who can't script there way out of a paper bag.

haunter 12-05-2003 04:31 AM

This still isnt working the way I wanted... I want it to perform the zoom command then set the image part with the zoomed image... @_@;

tlf288 12-05-2003 04:59 AM

just decide what pixels you want enlarged before enlarging them.

KainDaMan 12-05-2003 06:57 PM

Perhaps you should try showing the image, cropping it from it's 16x16 size, then zoom it... The changeimgpart command might not even take into consideration zoom factor, and thus you would have to crop from the 16x16 size rather than the zoomed size, even if it is already zoomed... that's just a guess btw, so don't hold me to it

Dach 12-05-2003 11:41 PM

I just wish that zooming wouldn't change the image's position, it makes it rather cumbersome to show a dynamically zoomed image at the correct position...

haunter 12-06-2003 12:23 AM

Well, that was just an example, what I really wanted to do was have a one pixel image of a certian colour so I could use it to make it look like a room was being filled with water.... I suppose I could use polygons... But only V3+ supports alpha blending for those, and I wanted the water to be translucent. :(


All times are GMT +2. The time now is 07:53 AM.

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