GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#21 2013-05-26 10:37:17

Miah_84
Member
Registered: 2013-05-23
Posts: 14

Re: draw_text_rtf

If your happy with its current state, then I will be focusing on my other projects.

I do have a question for you though....why do you have "#define draw_text_rtf" in your initial code?

I have been looking for something that shows the user the scripts arguments. As far as I am aware, there is no #define or /// for scripts to show something in the object when using the script. it currently shows "script_name(...)" but I would like it to show something like "script_name(argument0_name, argument1_name, .etc.)"

Do you know if there is something that does this? I'm considering turning in a suggestion about it.

Offline

#22 2013-05-26 12:41:58

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: draw_text_rtf

The #define line is the standard header for scripts in a *.gml file. When they are imported or exported from within the IDE it is expected for them to be there.

A way to prescribe the arguments of a script and have them appear in the IDE code editor has been suggested many times. It has been explained that it is not possible due to technical limitations with the IDE. The only way to get something like this is by adding the scripts to a GML extension.


Abusing forum power since 1986.

Offline

#23 2013-05-26 16:00:22

Miah_84
Member
Registered: 2013-05-23
Posts: 14

Re: draw_text_rtf

Thank you for the info. I'm not one for importing or exporting scripts since I usually build them for my own use. That is unfortunate that they can not manage a way to show the arguments, wish I could see what they were doing behind the scenes, maybe one day I'll help them build the software and be able to tinker with the UI a bit. But for now, back to making games smile

Offline

#24 2013-05-28 00:40:28

csanyk
Member
From: NE Ohio
Registered: 2011-04-07
Posts: 13
Website

Re: draw_text_rtf

Miah, thanks again for your work on this.  I'd be interested to see what else you work on, if you have a website where I can check out your projects.  PM the link to me if you don't mind, or include it in this thread.

Some feedback on the script... this from just looking at the code so far, have yet to test it fully:

It's inefficient to name all the .NET colors every time this script is called.  It would be more efficient to initialize the colors once in a separate script, and make the dslist that contains them a global variable.  A programmer who wants to add their own named color variables in their program can add them to the global dslists as they wish.

This line of code looks dangerous:

Expand        cn = string_copy(str,i,32)//random length, long enough to cover all names

If there is a color name longer than 32 characters in the dslist.  Also, what happens if 32 positions is past the end of the string?  I'll have to test this to see...

The underscore line drawing routine should suffice for most purposes, and I don't know how I'd improve it, but it's limited in that it will only look good with "normal-sized" fonts that will look correct when underlined with a 1-px wide line.

Offline

#25 2013-05-28 13:31:30

Miah_84
Member
Registered: 2013-05-23
Posts: 14

Re: draw_text_rtf

I do not have a website at the moment. That line was not intended for more names to be added to the ds_list. If an initialize script is going to be added to this, then I would also use surfaces instead of rendering the text each time. I am trying to provide a single script with as much functionality as possible without requiring initialization or outside scripts. A world of things could be done with this if it was multi script, but my concept was to make a simple plug and play style script for less experienced users to avoid complication and confusion. Please feel free to build an "advanced mode" multi script if you desire. I'm sure people would like that also. sub strings that are longer then the initial string just terminate after the end of the initial string as far as I have ever come across with gm, but please double check that for me.

Offline

#26 2013-05-28 14:44:28

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: draw_text_rtf

I agree with Miah_84's thinking here, at least for this site. What appeals to me most is this is a simple all-in-one script. For years I've used my own text system that does a lot of what this does and has animated effects, but it also encompasses a dozen scripts and requires a dedicated text object instantiated for each block of text. Its complexity is why I've never posted it here. This script is easy to use, and if someone needs greater performance from it, it is easy for the user to target a caching surface before calling the script.


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB