Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   drawLine() (https://forums.graalonline.com/forums/showthread.php?t=78427)

DustyPorViva 01-22-2008 07:32 PM

What he needs to do is get the angle of the line, then draw the points half of thickness 90 degree's out to each side.

Tolnaftate2004 01-22-2008 09:46 PM

Quote:

Originally Posted by Inverness (Post 1371137)
showimg() = GS1 >:(
As far as I'm concerned considering the way you can use findimg(), I consider showimg() to just be a remnant of GS1 existing for compatibility.

This is an awful way to think of it. showimg() is decidedly a function with a return value; it was not so in GS1.

It seems superfluous to me to use the with-findimg construct for (essentially) static images.

Chompy 01-22-2008 10:47 PM

Quote:

Originally Posted by DustyPorViva (Post 1371220)
What he needs to do is get the angle of the line, then draw the points half of thickness 90 degree's out to each side.

yeah :o

well, getangle(xy1[0]-xy2[0], xy1[1]-xy2[1]); would do that, but, I haven't got to work on this little function as much, because I've been busy with other stuff :(

Crow 01-22-2008 10:55 PM

showimg() being GS1? Try to use findimg() serverside.

Inverness 01-22-2008 11:36 PM

findimg() is listed in the serverside script functions.

I always use findimg() now because I don't want to alternate between two days of doing the same thing. findimg() works for the simple and the complex and is much more readable.
Quote:

Originally Posted by Tolnaftate2004 (Post 1371250)
showimg() is decidedly a function with a return value; it was not so in GS1.

There would have been no point for it returning an object in GS1. Also making it return the image object in GS2 was a good move.

So theres now 3 ways to do the same thing:
PHP Code:

// GS1
showimg(1"light3.png"3.53);
changeimgcolor(110.400);
changeimgvis(13);
// Half GS2
with (showimg(1"light3.png"3.53)) {
  
red 1;
  
green 0.4;
  
blue 0;
  
alpha 0;
  
layer 3;
}
// Full GS2
with (findimg(1)) {
  
image "light3.png";
  
thiso.3.5;
  
thiso.3;
  
red 1;
  
green 0.4;
  
blue 0;
  
alpha 0;
  
layer 3;



cbk1994 01-23-2008 01:06 AM

Quote:

Originally Posted by Inverness (Post 1371277)
code which says that things are gs1, half-gs2, and gs2]

How can you say GS1, half-GS2, and GS2? It's personal preference!

GS1 is

PHP Code:

showimg 200block.png1030

Half-GS2 is

PHP Code:

showimg 200block.png1030;
changeimgvis20020 ); 

GS2 is

PHP Code:

showimg200"block.png"1030 ); 

Just because something else was added does not mean previous functions were deprecated (though it may well be).

Inverness 01-23-2008 01:44 AM

Quote:

Originally Posted by cbkbud (Post 1371307)
<snip>

Okay, you're not understanding my point of view and I don't feel like explaining so lets just drop it.

Angel_Light 01-23-2008 02:35 AM

Invern is right, showImg(); was made just for compatibility with showimg; GS2 is technically not related to GS1. You should use findImg, it is more object oriented than showImg;

cbk1994 01-23-2008 03:00 AM

Quote:

Originally Posted by Inverness (Post 1371326)
Okay, you're not understanding my point of view and I don't feel like explaining so lets just drop it.

works4me

Admins 01-23-2008 06:38 PM

Quote:

Originally Posted by coreys (Post 1371062)
I think Graal should have brush functionality much like C#. ;(

There is the GuiDrawingPanel. It will soon be possible to also draw text and lines into that and may be used with showimgs.

Chompy 01-23-2008 07:07 PM

Quote:

Originally Posted by Stefan (Post 1371491)
There is the GuiDrawingPanel. It will soon be possible to also draw text and lines into that and may be used with showimgs.

Nice

Tolnaftate2004 01-23-2008 07:51 PM

Quote:

Originally Posted by Angel_Light (Post 1371339)
Invern is right, showImg(); was made just for compatibility with showimg;

No, there never existed anything called showimg(); in GS1; showimg; was retained for backwards compatibility.
Quote:

You should use findImg, it is more object oriented than showImg;
No, these two functions return the same thing. You can't say one is more OO than the other.

But showimg involves no lookup.

Crow 01-23-2008 08:14 PM

Quote:

Originally Posted by Inverness (Post 1371277)
findimg() is listed in the serverside script functions.

Never got findimg() to work serverside when I would want to display text.

Inverness 01-23-2008 11:43 PM

I seem to recall showtext working clientside only back in the GS1 days.
Quote:

Originally Posted by Tolnaftate2004 (Post 1371501)
No, there never existed anything called showimg(); in GS1; showimg; was retained for backwards compatibility.

No, these two functions return the same thing. You can't say one is more OO than the other.

But showimg involves no lookup.

Of course there was no showimg() in GS1 as that is a GS2 function equivalent. When the scripting engine reads GS1 script I'm pretty damn sure its just executing the GS2 equivalent of the function which would be showimg().

And how do you mean that showimg() involves no lookup?

Kristi 01-24-2008 12:28 AM

showimg is a fine function. I personally do something like
this.whatevz = showimg(whatevz);
then generally reference the variable when i want to change anything
this.whatevz.red = rad;


All times are GMT +2. The time now is 08:27 PM.

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