Note: This module has been remade, if you’re looking for the older version, there will be a link in the links section.
Update: This module is no longer being maintained, if you require a minimap module which is being maintained, I’ve linked one at the bottom of this post.
Why did you remake your module?
Well, the old module had many flaws and, it wasn’t optimised really well in my opinion so, I remade this module, more variables are localised reducing the need to index multiple tables at a time, this is done through the use of bindable events, so, if there’s a significant change (e.g. Frame size changes), certain ratios will be recalculated and an event will be fired which will cause certain local variables to be “reassigned”.
Preview
How to use the module?
Making an image
First, you’ll need an image to work with, you can create an image by manually creating one using Adobe Photoshop or, alternative, I recommend using Ro-Render Minimap Creator [RoRender], also, make sure to find out the center of your map/what the image represents since, positioning the minimap can be a bit tricky if you dont. To do this with RoRender, go to Workspace > Camera > MiniMapItems > CamFrame, make sure to save the position somewhere, such as Notepad.exe or some paper as it will be really important later on.
Creating a minimap object
Now that we have our map image, we can begin, first, we need to create a minimap object, we can do this by calling a module function in our module.
module.CreateMinimap(FrameSize, FramePosition, AnchorPoint, MapCenterPoint, PixelsPerStud, OriginalSize, Visible, OtherProperties, Key)
FrameSize can be a Udim2 value or false/nil, if it’s false/nil, it will be set automatically to UDim2.fromOffset(200, 200)
[200 x 200 pixels]
FrameSize can be a Udim2 value or false/nil, if it’s false/nil, it will be set automatically to UDim2.new(0, 5 , 1, -5)
FrameSize can be a Vector2 value or false/nil, if it’s false/nil, it will be set automatically to Vector2.new(0, 1)
MapCenterPoint will be the center of your map/(what your minimap represents), if an incorrect value is passed through, your minimap may not be correctly positioned.
PixelsPerStud is really important, it will be used to calculate certain ratios, it can be a table or a double/integer/float/number, if it’s a table, table[1] will be your pixels per stud in the x axis and table[2] will be your pixels per stud in the y axis or else, if it’s just a number, it will be assumed that it represents both the x axis and y axis.
OriginalSize is a table {number x, number y}, where number x/y represent the original size of the image in pixels, e.g. 1080 x 1920, if nothing is passed through, the absolute size of your map will be used instead.
Visible is a boolean and, it’s recommended that it should always be true, since, you’ll have to manually enable the map (ScreenGui) if you decide to pass through false.
OtherProperties is a table of properties, e.g. , if you wanted the frame to be opaque(have a transparency of 0) you could pass through {[“Transparency”] = 0}, this is only recommended if you know what you’re doing or else, it’s best to leave it as false/nil or an empty table.
Key can be anything, it will be used to return the map if you’re using multiple scripts for some reason, it’s recommended that your key is a string, if you don’t intend on using the minimap object from multiple scripts, you could leave the value as nil.
Importing a map image
Now that we’ve created a minimap object, we can now import our map, to do this, we can call the function/method
Minimap:ImportMap(Map, Size)
Map can be a frame/(image label) or, it can be a link to an image, it’s recommended that you don’t use a link since, you can’t be certain if it will load.
Size will only be used if you decide you use a link, if so, Size is a UDim2 value.
Importing a main blip
Now that we’ve imported our map, we can import a main blip, to do so, we can call the function/method
Minimap:ImportMainBlip(Blip, Part, UsingOrientation)
Blip will be the main blip, it can be a frame or an image label
Part will be your main part, this will determine the offset of your map
UsingOrientation will determine whether you want the blip to rotate, it can be either true or false
"Run"
Now that we’ve imported our map and main blip, we can “run” our minimap (doing calculations and updating the offset of our map), to do so, we can call the function/method
Minimap:Run()
Updating the main blip part
What if our main blip part is no longer our main part?
Well, in that case, we can call the method/function
Minimap:UpdateMainBlipPart(Part)
Part is your new main part
Adding blips
What if I want to add other blips?
Well, to add other blips, you can call the method/function
Minimap:ImportBlip(Blip, Part, Orientation, Enabled)
Blip is your blip image, it can be a frame or an image label
Part is the part the blip is going to represent
Orientation is a boolean and will determine whether the blip will be able to rotate
Enabled is a boolean and, will determine whether you want the blip to be visible or not visible.
Enabling/Disabling blips
To enable/disable a blip, you can call the method/function
Minimap:EnableBlip(Part)
Minimap:DisableBlip(Part)
Part is the part you used to add a blip.
Updating your main blip
To update the image/frame of your main blip, you can call the method/function
Minimap:UpdateMainBlip(Blip)
Removing a blip
You may want to remove a blip instead of disabling it to reduce the amount of resources/memory being used or to prevent any memory leaks.
If you don’t want to use a blip anymore, you can call the method/function
Minimap:RemoveBlip(Part)
Updating a blip part
Instead of adding a new blip each time, you may want to update the part it represents, to do so, you can call the method/function
Minimap:UpdateBlipPart(OldPart, NewPart)
OldPart is the part the blip used to previously represent and NewPart is the part it currently represents.
OldPart will be used for a table lookup to find the blip associated with it.
Updating a parts blip
You may want to update a blip that represents a part instead of adding a new blip, to do so, you can call the method/function
Minimap:UpdateBlipIcon(Part, NewBlip)
NewBlip is your new frame/(image label) that will represent your part.
Changing maps
You may want to rotate/change maps for some reason (e.g. a round based game where maps are random), to do so, you can call the method/function
Minimap:ChangeMap(Map, MapCenterPoint, PixelsPerStud, OriginalSize)
Map is your new map image
MapCenterPoint is the center of your map/(what your map represents), it is a Vector2 value where x represents the x axis of the center of your map and y represents the z axis of the center of your map.
e.g.
local MapCenterPoint = Vector2.new(Baseplate.X, Baseplate.Z)
PixelsPerStud is really important, it will be used to calculate certain ratios, it can be a table or a double/integer/float/number, if it’s a table, table[1] will be your pixels per stud in the x axis and table[2] will be your pixels per stud in the y axis or else, if it’s just a number, it will be assumed that it represents both the x axis and y axis.
OriginalSize is a table {number x, number y}, where number x/y represent the original size of the image in pixels, e.g. 1080 x 1920, if nothing is passed through, the absolute size of your map will be used instead.
If you have any suggestions/ideas/requests feel free to message me or post below.
Links
Remade Module
RoRender
Example game (uncopylocked)
What to do if you encounter problems
First, I’d recommend double checking any code you may have wrote to make sure you’ve passed through the correct arguments, then, you should check the dimensions of your image file and compare it to the values passed, if you still encounter problems, feel free to message me on the forums with your problem, and the arguments you’ve passed through.
This module is no longer being maintained but, it should still work though.
I recommend using this module if you want to use a module which is currently being maintained instead: