Now there are two ways to this, with either None, Cloggy or IanM's Matrix1 Utility plug-ins. This one shows Cloggys, and I do not think IanM's Matrix1 Utility is needed here. This one can be modified by just removing the Cloggy D3D commands and replacing them with DBPro native commands, but I read somewhere that Cloggy's should be faster, and also read that some had troubles with this plugin running.
I need to set DRAW SPRITES FIRST, then call my update_ui_images and lastly I update the text:
#include "Functions\load_images.dba"
#include "Functions\create_main_ui.dba"
#include "Functions\ui_names_links.dba"
#include "Functions\button_click.dba"
#include "Functions\scroll_map.dba"
#include "Functions\setup_map_grid.dba"
`set ups
draw sprites first
rem draw sprites manual
rem backdrop off
sync on
sync rate 60
autocam off
position camera 3,-5,0
rotate camera -90,0,0
d3d_font 1,"system",40,0,0,0
`temporary set ups
setup_map_grid()
`globals
global current_ui$
global button_1_link$
global button_2_link$
global button_3_link$
`call images
load_images()
`create gui
create_main_ui()
`first ui to load
current_ui$ = "main_ui"
do
`check if mouse is within lowest row of buttons and then use the function
if mousey() > 692 and mousey() < 769 and mouseclick() = 1 and mouse_single_click = 0 then button_click()
`check if mouse is within bottom scroll bar and then use function
if mousey() > 617 and mousey() < 693 and mouseclick() = 1 then scroll_map()
if mouseclick() = 1 then mouse_single_click = 1
if mouseclick() = 0 then mouse_single_click = 0
update_ui_images()
rem draw sprites
call function name current_ui$
sync
loop
function create_main_ui()
`create buttons
sprite 1,0,693,1
sprite 2,200,693,1
sprite 3,400,693,1
`create scroll bars and buttons
`left scroll button
sprite 10,0,618,2
`right scroll button
sprite 11,949,618,3
`bottom scroll bar
sprite 12,75,618,6
`bottom scroll marker
sprite 13,75,618,8
`scroll up button
sprite 14,0,0,4
`scroll down button
sprite 15,0,543,5
`left scroll bar
sprite 16,0,75,7
`left scroll marker
sprite 17,0,75,8
endfunction
function update_ui_images()
`paste buttons
paste image 1,0,693
paste sprite 2,200,693
paste sprite 3,400,693
`create scroll bars and buttons
`left scroll button
paste sprite 10,0,618
`right scroll button
paste sprite 11,949,618
`bottom scroll bar
paste sprite 12,75,618
`bottom scroll marker
paste sprite 13,sprite x(13),sprite y(13)
`scroll up button
paste sprite 14,0,0
`scroll down button
paste sprite 15,0,543
`left scroll bar
paste sprite 16,0,75
`left scroll marker
paste sprite 17,sprite x(17),sprite y(17)
endfunction
function main_ui()
`set up font, color and size
rem ink rgb(50,50,50),0
rem set text size 40
d3d_starttext
`names for buttons
`button 1
button_1$ = "FILE"
button_1_link$ = "file_ui"
x_text = (100-((len(button_1$)*20)/2))
d3d_text 1,100,718,1,button_1$
d3d_endtext
`button 2
button_2$ = "TILES"
button_2_link$ = "tiles_ui"
x_text = (100-((len(button_2$)*20)/2))
text 200+x_text,718,button_2$
`button 3
button_3$ = "GRID"
button_3_link$ = "grid_ui"
x_text = (100-((len(button_3$)*20)/2))
text 400+x_text,718,button_3$
endfunction
function file_ui()
`set up font, color and size
ink rgb(50,50,50),0
set text size 40
`names for buttons
`button 1
button_1$ = "MAIN"
button_1_link$ = "main_ui"
x_text = (100-((len(button_1$)*20)/2))
text x_text,718,button_1$
`button 2
button_2$ = "empty"
button_2_link$ = "empty"
x_text = (100-((len(button_2$)*20)/2))
text 200+x_text,718,button_2$
endfunction
function tiles_ui()
`set up font, color and size
ink rgb(50,50,50),0
set text size 40
`names for buttons
`button 1
button_1$ = "MAIN"
button_1_link$ = "main_ui"
x_text = (100-((len(button_1$)*20)/2))
text x_text,718,button_1$
`button 2
button_2$ = "empty"
button_2_link$ = "empty"
x_text = (100-((len(button_2$)*20)/2))
text 200+x_text,718,button_2$
endfunction
function grid_ui()
`set up font, color and size
ink rgb(50,50,50),0
set text size 40
`names for buttons
`button 1
button_1$ = "MAIN"
button_1_link$ = "main_ui"
x_text = (100-((len(button_1$)*20)/2))
text x_text,718,button_1$
`button 2
button_2$ = "SETUP"
button_2_link$ = "setup_grid"
x_text = (100-((len(button_2$)*20)/2))
text 200+x_text,718,button_2$
`button 3
button_3$ = "GRID"
rem button_3_link$ = "grid_ui"
x_text = (100-((len(button_3$)*20)/2))
text 400+x_text,718,button_3$
endfunction
The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...