GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Script Submission » draw_text_outline() » 2015-08-26 07:53:43

mike.dailly
Replies: 1
Expand/// draw_text_outline(x,y,colour,text)
//
//  Draws black outline text using the currently supplied colour.
//  Will reset alpha level to 1.0
//
//  usage example:-
//          draw_text_outline(10,10,c_yellow,"Hello World");
//
/// GMLscripts.com/license
draw_set_colour(c_black)
draw_set_alpha(1.0);
draw_text(argument0-1,argument1, argument3);
draw_text(argument0+1,argument1, argument3);
draw_text(argument0,argument1-1, argument3);
draw_text(argument0,argument1+1, argument3);
draw_set_colour(argument2);
draw_text(argument0,argument1, argument3);

My fall back standard outline text rendering. Easy to modify for special uses, but usually used as-is for 99% of cases.

#2 Re: GML Reference » Disturbing Game Maker Surface Creation Tests » 2011-12-20 11:38:10

surface_exists() is definitely the way you should be checking. That way you keep creation down to when you actually need it. You should ALWAYS assume that allocation and freeing is slow.

#3 Re: GML Reference » Disturbing Game Maker Surface Creation Tests » 2011-12-20 07:06:15

The first thing I would say, is no matter what the platform, you REALLY don't want to create surfaces "all" the time. You create them once and keep them around. Since moving to hardware rendering this is even more important as surfaces are created "on card" using VRAM, and this is a limited resource. So if you make several large surfaces all the time, you will very quickly fragment memory and never be able to allocate one again.

In "real" cases (i.e. in a game), you will create a surface on object creation, and then keep it around which is what you really want to do.

As a general rule, you should really try and pre-allocate stuff before playing a level, as allocation is always slow.

It's also no surprise hat you can get render targets over a certain size, as this will be limited by your graphics card, and the hardware rendering API. For example, I easily get 2048x2048 at 60fps (WebGL), but jumping to 4096x4096, it drops like a stone - I'm surprised it even did it.

GM8 and lower were all Software rendering, which means it could have ANY size you wanted, and with the amount or RAM usually available to the CPU, you're not very likely to hit issues. However, hardware rendering should outpace the CPU - particularly once we move to the C++ render which batches things properly, although even on the Delphi runner I'd expect better performance  when your doing more than just playing with a couple of surfaces.

So, no... not a bug. Hardware limits. And if you need an 8kx8k surface, I'd question why - it's a bad idea that BURNS memory 512Mb bytes per surface to be precise (surfaces also include depth buffers as well remember). Not a good idea - ever.

#4 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-11-25 07:03:39

Russell was trying to get in touch with you about this. Can you email me please (if you haven't spoken to him already) smile

#5 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-10-20 11:25:36

No it's not.... it's like putting an accessor on every class variable, and disabling inlining.  The slow down would be ridiculous! You lose SO much performance by doing calls all the time, rather than taking the extra time and care to write your code.

We can't check stuff that goes direct to variables, particually as in GML a variable can be "anything". It's typeless, so who are we to say that variable "X" is a number and not a string? Sure the built in ones are, but it may already be a NAN by the time you come to set the built in one and your still going to have to debug it yourself.

But at least you now have a full source level debugger built into most browsers so you CAN find out.

Really... if your coding in script, there's only so much we can do to protect you without crippling it for everyone else.

We have started to put in some "debug" specific code that swaps in extra checks at runtime, but there are well over 1,000 functions so these will take time to expand out.

If I had my way, I'd be forcing you to use "X" for numbers and "X$" for strings. Basic had it right in my mind.... but we can't do that, mores the pitty.

#6 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-10-19 11:53:48

You can't have it both ways.... we can either validate EVERY variable access by going through functions for everything - which is dog slow, or you can go direct to the variables and get code as fast as JavaScript allows, but deal with stuff like this.

Most users would rather have the speed..... at least that's what they're always shouting about. smile

#7 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-10-04 11:00:15

Okay... this is a rendering issue with the browsers... but I don't think it's going to go away. I need to rewrite the full-screen part completely.  sad

#8 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-10-04 10:18:21

Yeah... took longer than it should have. The issue was a combination of having to write out "\" to text file (so the javascript had them), and parsing them once they were in memory and gone, AND the fact that the debuggers show them always... even if they aren't there. Messes with your head. smile

@BlaXun I presume you mean when you zoom to full screen or something, as they don't appear 1:1...?

#9 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-10-04 08:44:13

We try to fix show stoppers first, then try and pick off the simple ones next. outside that it's whatever bit of code we're currently in as that's where our "thinking" is at. If you are truly "stumped" and can't progress, then adding a comment to the bug bumps it up the list and it'll get reviewed again (as we tend to go by the one line description for picking whats next).

Worst case, ping us on twitter (@mdf200 ,  @russellkay) if you need help "now". We can't promise immediate action, but we do try to help when it's possible.

#10 Re: GML Reference » GameMaker:HTML5 - Things that work differently » 2011-10-04 07:37:17

Please don't.... Just because tickets are unassinged doesn't mean we don't see and read them. I spend hours shifting through them, and really don't want them doubled up...

Board footer

Powered by FluxBB