GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2021-02-03 03:42:59

Jacko
Member
Registered: 2021-02-03
Posts: 1

Draw point of specified size

should be self-explanatory, point size expands from center

Expand/// @func   draw_point_size(x,y,size)
///
/// @desc   Draws a point of the specified size
///
/// @arg    {real}    x,y         position
/// @arg    {real}    width         width of point in pixels, real
///
/// GMLscripts.com/license
{
	var _x, _y, size
	_x = argument0;
	_y = argument1;
	size = argument2;

	draw_rectangle(_x-(size/2),_y-(size/2),_x+(size/2),_y+(size/2),false);
	return 0;
}

Offline

#2 2021-02-16 09:39:20

gnysek
Member
Registered: 2011-12-29
Posts: 24

Re: Draw point of specified size

Issue with this is that depending of GPU (Intel/GeForce/AMD) rectangle might be offset by 1px, and when you use odd number, you have no idea on which pixel it will be rounded in this case. So, the result might be even ~2px wrong.

Offline

Board footer

Powered by FluxBB