Jump to content


Photo

Extra Draw Functions V1.5 3/26/07


  • Please log in to reply
90 replies to this topic

#1 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 02 March 2007 - 02:16 AM

I wrote this extension package for GM7 primarily to test out the extension system.

This adds a few new draw functions, like draw_rectangle_direction, draw_polygon, draw_star and draw_wave. the included help file lists them all.
it also adds a few more default colors such as c_pink and c_brown.

update 1: This includes several new functions such as draw_arc, draw_ring, and draw_clock.
update 2: new functions include a few color editing functions such as draw_lighten_color and draw_darken_color, a few sprite related functions and draw_line_glow
update 3: Colorized functions to go with most of the previous functions and a few new time and string related functions. 15 new.
update 4: A lot of error fixes, and a few new functions such as draw_frame (thats like a picture frame, not one frame of an animtation)
update 5: A few error fixes, 7 new functions including draw_diamond, draw_roundrect_custom, and draw_crosshair. Also redid the help file.
now includes a total of 48 functions:

draw_square, draw_square_color
draw_rectangle_direction, draw_rectangle_direction_color
draw_roundrect_custom, draw_roundrect_custom_color
draw_frame, draw_frame_color
draw_circle_edge, draw_circle_edge_color
draw_ellipse_center, draw_ellipse_center_color
draw_ring, draw_ring_color
draw_arc, draw_arc_color
draw_polygon, draw_polygon_color
draw_polygon_direction, draw_polygon_direction_color
draw_diamond, draw_diamond_color
draw_star, draw_star_color
draw_star_direction, draw_star_direction_color
draw_linefield, draw_linefield_color
draw_vector, draw_vector_color
draw_line_glow
draw_pointfield
draw_points_random
draw_wave, draw_wave_color
draw_sprite_mirror
draw_mask
draw_string
draw_clock, draw_clock_real
draw_timer
draw_time, draw_time_real
draw_set_color_alpha
draw_fix_color
draw_darken_color, draw_lighten_color
draw_crosshair
(bold indicates new functions)

Here's the link: Download -- 11kb

If you have installed a previous version, you will need to reinstall it to get the new functions.

please tell me what you think and feel free to suggest other functions you would like to see in future versions.

Edited by zephiel87, 26 March 2007 - 11:28 PM.

  • 0

#2 pcnerd

pcnerd

    GMC Member

  • New Member
  • 197 posts

Posted 03 March 2007 - 03:46 AM

I'll definitely use draw_linefeild, but I don't get the draw_rectangle_direction.
  • 0

#3 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 03 March 2007 - 04:21 AM

you dont get it as in you dont understand how to use it? or you dont get why it would be useful?

its easy to use...
draw_rectangle_direction(top left x value, top left y value, width f rectangle, length of rectangle, direction of horizontal edges, whether or not to only draw the outline)

and i find it funny that you say you like linefield the best. in my opinion its one of the least useful ones in the set. (i suppose it could be useful for drawing a grid...)

the next version (i might upload it later tonight) will have draw_ring, draw_arc, draw_vector, and possibly a few more... does anyone have any other ideas?
  • 0

#4 pcnerd

pcnerd

    GMC Member

  • New Member
  • 197 posts

Posted 03 March 2007 - 03:00 PM

I don't get what the draw_rectangle_direction is.
Does it draw um... what does it draw?
  • 0

#5 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 03 March 2007 - 05:02 PM

it draws a rectangle at an angle...
  • 0

#6 callum

callum

    GMC Member

  • New Member
  • 176 posts

Posted 03 March 2007 - 09:53 PM

link down!
  • 0
Extensions: EditBox

#7 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 04 March 2007 - 03:59 AM

it works for me...

anyway, ive got another daily update, so try it again.
  • 0

#8 Ansgar

Ansgar

    OM Studios

  • New Member
  • 333 posts

Posted 04 March 2007 - 10:27 AM

Nice extension, I just found a little typo in the help file:

draw_pointfield(x1,y1,hnumb,vnumb,hdist,vdist)
Draws a set of points starting with (x1,y1). Hnumb and vumb are the number of points drawn in each direction, and hdist and vdist is the distance between each point.

Sorry for my perfectionism... :D

Also, have you considered using CHM instead of HLP help file? It looks much better and is used by most of the other extensions and of course Game Maker itself. :D

A suggestion for the draw_arc function:
If you use this function with a larger radius, the arc looks too polygonish - is not smooth enough. So you could have the arc precision as another argument.

-Ansgar-

Edited by Ansgar, 04 March 2007 - 11:04 AM.

  • 0

#9 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 05 March 2007 - 09:40 PM

thanks for the typo, i will be sure to fix it.

as for the arc_precision, i was wondering if anyone knew how to access the variable set by the draw_set_circle_precision() function. if it cant be done i will probably add a precision argument for both arc and ring.

i may upgrade to chm, but i already had a .hlp creator and didnt want to look for a chm creator. if you know any good ones please tell me. thanks.
  • 0

#10 antidote

antidote

    GMC Member

  • New Member
  • 117 posts

Posted 05 March 2007 - 11:42 PM

Microsoft has a CHM maker and it has an in depth Help file (which i suggest reading before hand) it's really handy but confusing to use with out reading the help file. So step away from .HLP it's ancient and ugly
  • 0

#11 Seeker

Seeker

    GMC Member

  • GMC Member
  • 366 posts

Posted 06 March 2007 - 12:59 AM

Get Help Scribble from helpscribble.com. It's free, easy, and it allows you to choose the type of output for your files. You can create a .HLP or a .CHM, and then with the click of a button, convert a .HLP to a .CHM and vice versa. I like the .HLP format better, because they run considerably faster, and they don't require an internet connection. If you make a .CHM, you'll probably want to include a .HLP in your distribution anyway, since not everybody likes to or can access the internet when using a help file.

Nice extension.

Edited by Seeker, 06 March 2007 - 01:00 AM.

  • 0

#12 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 06 March 2007 - 04:52 AM

thanks for the info. ill look into for the next release.

as for now, ive got another update with colorized versions for most of the previous scripts.
functions like draw_ring_color and draw_polygon_color now exist!

there are also a few new time and string related functions.
  • 0

#13 rinkuhero

rinkuhero

    Paul Eres

  • GMC Member
  • 1919 posts
  • Version:GM:Studio

Posted 06 March 2007 - 07:15 PM

This is a good extension; would you consider adding anti-aliased shapes as per my method here? It makes shapes look much nicer (although it's generally three times as slow, so there's a trade-off).
  • 0

#14 buji_ryu

buji_ryu

    GMC Member

  • New Member
  • 324 posts

Posted 06 March 2007 - 08:05 PM

Probably one of the best extensions that I've tested so far. Good job, and very useful
  • 0

#15 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 06 March 2007 - 09:53 PM

thanks for the coninued support!

@rinkuhero: ill consider it for future versions. if i do use it i will give you credit in the help file.
  • 0

#16 mattb64

mattb64

    GMC Member

  • New Member
  • 137 posts

Posted 08 March 2007 - 07:12 PM

Great extension, but I have a question.
Can"draw_sprite_mirror" be used like a reflection in the water? If it can't that would be a good function to add.
Also "draw_mask" is very nice, but you could make it better. I mean make the mask in front of the player's sprite or maybe make the player's sprites transparent. Because I can barely see the mask behind the player.
Other then that, this is a great extension.
  • 0

#17 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 08 March 2007 - 09:43 PM

draw_sprite_mirror could be used to create a reflection. you would probably want to mirror it along the y-axis and it would be up to the user to make sure the reflection is in the right location.


if you want the mask drawn on top of the sprite draw the sprite first then the mask.
  • 0

#18 antidote

antidote

    GMC Member

  • New Member
  • 117 posts

Posted 08 March 2007 - 10:43 PM

Get Help Scribble from helpscribble.com. It's free, easy, and it allows you to choose the type of output for your files. You can create a .HLP or a .CHM, and then with the click of a button, convert a .HLP to a .CHM and vice versa. I like the .HLP format better, because they run considerably faster, and they don't require an internet connection. If you make a .CHM, you'll probably want to include a .HLP in your distribution anyway, since not everybody likes to or can access the internet when using a help file.

Nice extension.

<{POST_SNAPBACK}>


Not true, I don't have internet access at home and I can use CHM's just fine. Please check facts before posting things like that.

EDIT:
Such as disconnecting your network or modem and testing the file. Also i seem to have problems getting .HLP's to load with any decent amount of speed i.e. the window remains blank for several seconds before loading the text. While .CHM's load almost instantly on my machine (could be how I have it configured)

Otherwise, buy HelpScribble now! It costs only US$ 99

Hardly seems free to me and...

The evaluation version does not expire. All functionality for building WinHelp and HTML Help files is available. The free evaluation version does add a small note to your help topics, reminding you to purchase the full version of HelpScribble prior to distributing your work. A simple recompile with the full version will remove those notes.

That is an annoyance.

Edited by antidote, 08 March 2007 - 10:51 PM.

  • 0

#19 mattb64

mattb64

    GMC Member

  • New Member
  • 137 posts

Posted 08 March 2007 - 10:55 PM

draw_sprite_mirror could be used to create a reflection. you would probably want to mirror it along the y-axis and it would be up to the user to make sure the reflection is in the right location.


if you want the mask drawn on top of the sprite draw the sprite first then the mask.

<{POST_SNAPBACK}>

When I use "draw_sprite_mirror" I just get the sprite below the character, not reversed.
This is the code and this is a platform game.
draw_sprite_mirror(sprite_index,-1,x+15,y,1)
Also the draw mask thing works.
  • 0

#20 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 09 March 2007 - 12:46 AM

i looked at my code again and found out you were right. it didnt correctly check which axis you selected and always mirrored along the xaxis. it will be fixed in the next version. thanks for pointing that out!
  • 0

#21 mattb64

mattb64

    GMC Member

  • New Member
  • 137 posts

Posted 09 March 2007 - 01:45 AM

i looked at my code again and found out you were right. it didnt correctly check which axis you selected and always mirrored along the xaxis. it will be fixed in the next version. thanks for pointing that out!

<{POST_SNAPBACK}>

No problem, but when you update it will you be adding more functions or just fixing that?
  • 0

#22 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 09 March 2007 - 03:48 AM

i will fix that as well as a few other errors i have found, and add a few more functions... not sure what though... any ideas?
  • 0

#23 Wiggles

Wiggles

    <Your Ad Here>

  • New Member
  • 323 posts

Posted 09 March 2007 - 04:15 AM

Useful extension.
How about a function to draw rounded rectangles in which you can specify the roundedness so like a roundedness of 1 would make something like this:
Posted Image
but a roundedness of 0 would make something like this:
Posted Image
and of course as the number changes (which is between 0 and 1) the roundedness would change accordingly so that a roundedness of 0.5 would make something like this:
Posted Image

PS: I'm not sure that roundedness is a word. :)

Edited by Wiggles, 09 March 2007 - 04:22 AM.

  • 0

#24 th15

th15

    GMC Member

  • GMC Member
  • 1585 posts
  • Version:Unknown

Posted 09 March 2007 - 04:39 PM

You really need to optimize this extension. I tried using it to replace some of my own drawing scripts (namely, drawing a line with a glow and drawing an arc sector of a circle) and my own scripts in GML are on par if not faster.

Granted your arc drawing code is quite fast for the amount of precision it gives, but without any control over the accuracy, it's still slower than my current code.

Your draw_line_glow is quite slow compared to drawing the same thing but using repeated circles along the line for glow.
  • 0

Sean 'th15' Chan
site_logo.gif


#25 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 09 March 2007 - 10:00 PM

the next version will allow you to change the precision for the arc and the ring functions. and i use draw_line_width to define my glowing line, so im not sure why its so much slower.

@wiggles, thanks for the idea, i will definately consider it for the next version.
  • 0

#26 tkneo

tkneo

    GMC Member

  • New Member
  • 120 posts

Posted 10 March 2007 - 01:49 AM

You put two draw wave functions which have different arg numbers means neither of them work because GM checks for the one you don't use if u get mah jist

edit: plus do you think you could post an editable of your scripts so people like me can get a better understanding of your scripts

Edited by tkneo, 10 March 2007 - 01:54 AM.

  • 0

#27 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 10 March 2007 - 03:57 AM

You put two draw wave functions which have different arg numbers means neither of them work because GM checks for the one you don't use if u get mah jist

edit: plus do you think you could post an editable of your scripts so people like me can get a better understanding of your scripts

<{POST_SNAPBACK}>

the draw wave function with the colors shoulod be draw_wave_color... if you use that instead it should work. the help line will be fixed in the next version.

i prefer not to reales editables of my entire code, but if you have any specific question about how something works i would be gald to help you.

EDIT: alright new version is uploaded, all these errors have now been fixed.

Edited by zephiel87, 10 March 2007 - 04:21 AM.

  • 0

#28 tkneo

tkneo

    GMC Member

  • New Member
  • 120 posts

Posted 10 March 2007 - 08:04 AM

i have a few suggestions but i don't know if they are possible. draw_text_glow would be freaking awesome if it could be done like draw line glow!
the next one is draw_button_text and so it would be an easier and more efficient way of doing buttons
  • 0

#29 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 10 March 2007 - 04:33 PM

great ideas. draw_text_glow would be possible, but it would probably run quite a bit slowere than just a line (obviously) ill look into it anyway.

and i have been thinking about doing more button functions (such as round buttons) so this will fit in great with that.
  • 0

#30 tkneo

tkneo

    GMC Member

  • New Member
  • 120 posts

Posted 11 March 2007 - 02:12 AM

sweet!
  • 0

#31 Yux89

Yux89

    GMC Member

  • New Member
  • 75 posts

Posted 11 March 2007 - 07:49 AM

Zephiel87, I just found out that using "draw_line_glow" can make drawn stuff disappear (both stuff that's built into gm and stuff drawn with your extension), such as rectangles and text. Also, if you use "draw_star_color", checking your script will say that there is an error even though there isn't one. Other than that though, great extension. :(

Edited by Yux89, 12 March 2007 - 04:44 PM.

  • 0

#32 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 12 March 2007 - 08:45 PM

i have never encountered either of the problems you just addressed. could you please explain the situation a bit better.
  • 0

#33 Dragonos

Dragonos

    Multimedia Pro

  • New Member
  • 357 posts

Posted 12 March 2007 - 10:54 PM

Great!
How about...
Draw_sprite_trail(Sprite,Fade speed,size increment)
Draws a fading trailing sprite to get an Motion blur effect.

or

set_antialiasing(Amount,True or false)
Sets soft edges
  • 0

#34 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 13 March 2007 - 02:36 AM

draw_sprite_trail is apossibility. i'll think about it.

however, fullscreen antialiasing is not. gm just cant run fast enough to support it well. not by any moethods i know anyway.
  • 0

#35 softhunterdevil

softhunterdevil

    LazyBoy

  • GMC Member
  • 276 posts

Posted 14 March 2007 - 03:41 PM

Its a very good extension ... Making drawing things easy.:)
But can you please list all the functions available on the first post ?
So that the versatility and importance of the script can be judged from the first post. Then the interested user will download it.
  • 0
<a href="http://www.redbubble...eactdevelopers" target="_blank"><img src="http://www.redbubble...rb_profile.gif" border="0" class="linked-sig-image" /></a><a href="http://www.redbubble...eactdevelopers" target="_blank"><img src="http://www.redbubble...ers_banner.jpg" border="0" class="linked-sig-image" /></a>

#36 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 14 March 2007 - 08:41 PM

done! i had thought about listing them before, but decided against it because of the space it takes up. but since you suggested it, i decided to go for it.
  • 0

#37 tkneo

tkneo

    GMC Member

  • New Member
  • 120 posts

Posted 19 March 2007 - 06:38 AM

are you going to mae any more updates??? these are soooo useful
  • 0

#38 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 20 March 2007 - 02:24 AM

are you going to mae any more updates??? these are soooo useful

<{POST_SNAPBACK}>

i will eventually, ive been busy lately, and havent had much time to work on it
  • 0

#39 softhunterdevil

softhunterdevil

    LazyBoy

  • GMC Member
  • 276 posts

Posted 21 March 2007 - 04:02 AM

are you going to mae any more updates??? these are soooo useful

<{POST_SNAPBACK}>

i will eventually, ive been busy lately, and havent had much time to work on it

<{POST_SNAPBACK}>


Few ideas came to my mind ...(these give animation to text)

1a. draw_text_typed(x,y,string,speed,loop)
1b. draw_text_typed_color(x,y,string,speed,loop,c1,c2,
c3,c4,alpha)

2a. draw_text_fadein(x,y,string,speed,loop)
2b. draw_text_fadein_color(x,y,string,speed,loop,c1,c2
,c3,c4,alpha)

3a. draw_text_wavy(x,y,string,speed,loop)
3b. draw_text_wavy_color(x,y,string,speed,loop,c1,c2,c
3,c4,alpha)

4a. draw_text_random(x,y,string,speed,loop)
4b. draw_text_random_color(x,y,string,speed,loop,c1,c2
,c3,c4,alpha)

5a. draw_text_shaky(x,y,string,speed,loop)
5b. draw_text_shaky_color(x,y,string,speed,loop,c1,c2,
c3,c4,alpha)

Hope you understood them.
  • 0
<a href="http://www.redbubble...eactdevelopers" target="_blank"><img src="http://www.redbubble...rb_profile.gif" border="0" class="linked-sig-image" /></a><a href="http://www.redbubble...eactdevelopers" target="_blank"><img src="http://www.redbubble...ers_banner.jpg" border="0" class="linked-sig-image" /></a>

#40 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 21 March 2007 - 04:08 AM

they are interesting ideas, but i think they might be better suited to another extension. you should consider making your own completely text based extension with those, the glowing text that was suggested earlier, maybe all the vk constant extension going around, and whatever else you can come up with.
if you need help with anything, just ask me. i can help write some of those functions, i just dont want to put them with this extension. Maybe ill do a text extension myself at some point.
  • 0

#41 softhunterdevil

softhunterdevil

    LazyBoy

  • GMC Member
  • 276 posts

Posted 21 March 2007 - 04:16 AM

As you wish ... :medieval:
Ok ... I may try to do these functions myself and make available as package.
  • 0
<a href="http://www.redbubble...eactdevelopers" target="_blank"><img src="http://www.redbubble...rb_profile.gif" border="0" class="linked-sig-image" /></a><a href="http://www.redbubble...eactdevelopers" target="_blank"><img src="http://www.redbubble...ers_banner.jpg" border="0" class="linked-sig-image" /></a>

#42 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 22 March 2007 - 03:46 AM

sounds good. just ask if you need help with anything.
  • 0

#43 Yux89

Yux89

    GMC Member

  • New Member
  • 75 posts

Posted 22 March 2007 - 01:26 PM

i have never encountered either of the problems you just addressed. could you please explain the situation a bit better.

<{POST_SNAPBACK}>


http://biancagames.com/gm7starprob.gif
^ this should explain the problem with draw_star_color (note the function still works in spite of that error being shown)

As for my problem with draw_line_glow, I really can't think of any way to describe it better, like I said, it makes other drawn stuff, such as rectangles and text (both from built in gm draw functions as well as other functions from your extension), disappear.

Edited by Yux89, 22 March 2007 - 01:27 PM.

  • 0

#44 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 23 March 2007 - 01:00 AM

did you add the extension in that game? (click 'extension packages', select extra draw functions, and click the arrow in the middle to add it)
i get that error when its not added, but not when it is. that mights solve the problem with draw_line_glow as well.
  • 0

#45 Yux89

Yux89

    GMC Member

  • New Member
  • 75 posts

Posted 23 March 2007 - 01:11 AM

Yes I did add it and I know I did because I had successfully used one of it's other functions (draw_ring_color) without any problem, and it recognized it as a valid function as well. The error is specific to draw_star_color I tell ya.

Edited by Yux89, 23 March 2007 - 01:13 AM.

  • 0

#46 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 23 March 2007 - 03:15 AM

there is no problem with the code. it works fine for me, and no one else has complained. it has something to do with the way you are using it.

do you have the most recent version? i dont think i changed that, but maybe...
  • 0

#47 Yux89

Yux89

    GMC Member

  • New Member
  • 75 posts

Posted 23 March 2007 - 12:24 PM

I have version 1.1. Is that the newest?
  • 0

#48 zephiel87

zephiel87

    GMC Member

  • New Member
  • 1649 posts

Posted 23 March 2007 - 08:45 PM

no... look at the first post... how many updates are listed? 4... that would make 1.4 the current version...
  • 0

#49 Yux89

Yux89

    GMC Member

  • New Member
  • 75 posts

Posted 23 March 2007 - 09:03 PM

It recognizes it now. :D
I don't know why I had been thinking I had the latest version, when of course, I didn't. I also see you added a new argument to draw_ring_color, called precision. Keep on updatin' and making new functions! :D

Edited by Yux89, 23 March 2007 - 09:04 PM.

  • 0

#50 e_barroga

e_barroga

    ES Studios Leader

  • GMC Member
  • 2475 posts

Posted 23 March 2007 - 10:26 PM

I have a question. Can this extension be used with commercial projects as well?

-e_barroga
  • 0

rsa_gmc_sig.png

 

logoGIF1.gif EXTENSION. PM TO PURCHASE LICENSE.