Blockland Forums > Modification Help
Adding image overlay/GUI to screen
xS K I D z:
--- Quote from: Crøwn on March 03, 2018, 12:16:38 PM ---Well that really depends on what you're trying to do. You can add a bitmap control to any GUI in Blockland to make your image appear. The PlayGUI example was just assuming you wanted to have the image on your screen while in a server. It doesn't have to be like that, you could put the image in a menu that you open with a keybind.
--- End quote ---
Actually I got it to show up in-game :) Thanks. But now I would like it to resize itself according to other player's screen resolutions so it's not getting cut off for being too big or being too small an image for the screen coverage. I thought I could do this by using the getExtent method on PlayGui and then use the width and height return from that to resize the bitmap. But I'm having trouble figuring it out as it gives me an error saying "PlayGui::getExtent--wrong number of arguments" or some such. Any idea how I would fix this? I'm using this reference (GuiControl - Page 298): http://greekmods.webs.com/docs/Appendix%20A%20-%20Quick%20References.pdf
PhantOS:
try $pref::Video::resolution. it has 4 numbers attached to it- word 0 is the window width, word 1 is the height. you'd only really need those numbers.
Crøwn:
--- Quote from: xS K I D z on March 03, 2018, 12:59:05 PM ---Actually I got it to show up in-game :) Thanks. But now I would like it to resize itself according to other player's screen resolutions so it's not getting cut off for being too big or being too small an image for the screen coverage. I thought I could do this by using the getExtent method on PlayGui and then use the width and height return from that to resize the bitmap. But I'm having trouble figuring it out as it gives me an error saying "PlayGui::getExtent--wrong number of arguments" or some such. Any idea how I would fix this? I'm using this reference (GuiControl - Page 298): http://greekmods.webs.com/docs/Appendix%20A%20-%20Quick%20References.pdf
--- End quote ---
PlayGui::getExtent(%this) is the definition of the function. It requires an object %this to be called. Most of the time you are using an object's method you can just call it right on the object like this: playGui.getExtent();. The function that I normally use to get the resolution of the client's screen is getRes() though.
xS K I D z:
--- Quote from: Crøwn on March 03, 2018, 01:12:38 PM ---PlayGui::getExtent(%this) is the definition of the function. It requires an object %this to be called. Most of the time you are using an object's method you can just call it right on the object like this: playGui.getExtent();. The function that I normally use to get the resolution of the client's screen is getRes() though.
--- End quote ---
Hmm still getting an error. Tried to echo getExtent to console a couple different ways and I'm still having trouble. This is what it says now:
--- Code: ---Add-Ons/Item_TeleTest/Item_TeleTest.cs (99): PlayGui::getExtent - wrong number of arguments.
Add-Ons/Item_TeleTest/Item_TeleTest.cs (99): usage: Get the width and height of the control.
BackTrace: ->[sportBallsPackage]ServerCmdUseTool->ServerCmdUseTool->ItemData::onUse->periTestImage::onMount
--- End code ---
PhantOS:
how are you echoing them? post code/ whatever you're typing in the console