I can't seem to get the panels down, I have played with it for three hours now nad can't seem to get it right. I have even tried to track how they are created but it just seems to be random... here is my set up.
the variables im using forthe coordinates.
--draw A panel from these two points
local panel_x1 = 80-- top left corner
local panle_y1 = 50 -- top right corner
-- to these two points
local panel_x2 = 80 --bottom right
local panel_y2 = 50 -- bottom left
The panel command itself
Panel(panel_x1,panel_y1,panel_x2,panel_y2)
the whole script
timer = {}
-- START OF CONFIGURATION OF THE SCRIPT -------------------------------------------------
local tod_act = 1 -- if you want to see am or pm
local time_enabled = 1 -- if you want the player to open the clock or not.
local twenty_four_hour_clock = 0 --0 for 12 hour days 1 for 24 hour days
local day_hours = 12 -- how many hours in A day
-- CONFIGURE THE POSTION OF THE CLOCK ----------------------------------------------------
--panel locations may want to set this first
--draw A panel from these two points
local panel_x1 = 80-- top left corner
local panle_y1 = 50 -- top right corner
-- to these two points
local panel_x2 = 80 --bottom right
local panel_y2 = 50 -- bottom left
-- then center text in the panel
local text_size = 1
local hour_x = 10
local hour_y = 50
local minute_x = 12
local minute_y = 50
local Second_x = 14
local second_y = 50
local tod_x = 16
local tod_y = 50
local second = 0
local minute = 0
local hour = 0
-- then choose these clock options
local twenty_four_hour_clock = 0 -- 0 = 12 hour clock 1 = 24 hour clock
local tod = "am" --time of day as in am and pm
-- END OF CONFIGURING THE SCRIPT ------------------------------------------
local show_clock = 0 -- button vars
local clock_pressed = 0 -- button var
function clock_init(e)
end -- init
timer[1] = 0
function clock_main(e)
--button press
if GetScancode() == 44 and clock_pressed == 0 then
clock_pressed = 1
if show_clock == 0 then
show_clock = 1
else
show_clock = 0
end
end
--button press
if GetScancode() == 0 then
clock_pressed = 0
end
--showing the clock
if show_clock == 1 then
Panel(panel_x1,panel_y1,panel_x2,panel_y2)
Text(hour_x,hour_y,text_size,""..hour)
Text(minute_x,minute_y,text_size,":"..minute)
Text(second_x,second_y,text_size,":"..second)
if tod_act == 1 then
Text(tod_x,tod_y,1,""..tod)
end
end
----- The time set up -----
if timer[1] == 0 then
timer[1] = g_Time + 1000 -- timer
elseif g_Time > timer[1] then
-- time
timer[1] = g_Time + 1000
--PromptDuration("second has passed",250) DEBUGGING
second = second + 1
end
if second == 60 then
--PromptDuration("minute has passed",250) DEBUGGING
minute = minute + 1
second = 0
end
if minute == 60 then
--PromptDuration("hour has passed",250) DEBUGGING
hour = hour + 1
minute = 0
end
if hour == twenty_four_hour_clock == 0 then
hour = 1
--to change am and pm
if tod_act == 1 then
if tod == "am" then
tod = "pm"
elseif tod == "pm" then
tod = "am"
end
else
hour = 0
end
end
----- time setup end -----
end -- main
he script works fine, I just can't seem to get the hang of panels and how they are drawn/created to the screen.... how is the grid is the center of the screen 50,50 or 0 like on a normal graph? when i use the x1 coordinate as 90 its at the top right of my screen, and when I put it at 1 its in the top let of my screen, and nothing seems to change that.. I'm lost with panels..... Sorry for the long post.
edit: remember the script works fine, I'm just focusing on the panels. if you run the script you will have to press z to see the panel but there will be random numbers cause I haven't placed the minutes/hours/seconds yet.
Markchapman10 is my Skype let's have some dev talk.