Imperial
Member
Hello
I was wondering how we can make a simple minimap but render It in a circular sprite
this is the script for the drawing the minimap
so my question is How we can mask and draw only circular area of the minimap
because the current code is working but It's rectangular
I was wondering how we can make a simple minimap but render It in a circular sprite
this is the script for the drawing the minimap
Code:
var minimap_x = argument0;
var minimap_y = argument1;
var minimap_xscale = sprite_get_width(spr_MiniMap_Background)/room_width;
var minimap_yscale = sprite_get_height(spr_MiniMap_Background)/room_height;
var scale = 1;
if(instance_exists(Player))
{
playerX = Player.x * minimap_xscale;
playerY = Player.y * minimap_yscale;
draw_sprite_ext(spr_player,0,minimap_x + playerX,minimap_y + playerY,minimap_xscale * scale,minimap_yscale * scale,Player.image_angle,-1,1);
}
for(i = 0; i < instance_number(Enemy); i++)
{
var current = instance_find(Enemy,i);
xx = current.x * minimap_xscale;
yy = current.y * minimap_yscale;
draw_sprite_ext(spr_enemy,0,minimap_x + xx,minimap_y + yy,minimap_xscale * scale,minimap_yscale * scale,current.image_angle,-1,1);
}
for(i = 0; i < instance_number(Tree); i++)
{
var current = instance_find(Tree,i);
xx = current.x * minimap_xscale;
yy = current.y * minimap_yscale;
draw_sprite_ext(spr_tree,0,minimap_x + xx,minimap_y + yy,minimap_xscale * scale,minimap_yscale * scale,current.image_angle,-1,1);
}
because the current code is working but It's rectangular