change ext to .xcur

master
chaosddp 2018-03-03 22:53:40 +08:00
parent 6a094dd69d
commit 283571f507
3 changed files with 14 additions and 17 deletions

View File

@ -108,7 +108,6 @@ void defos_disable_window_resize()
void defos_set_cursor_visible(bool visible)
{
}
bool defos_is_cursor_visible()
@ -173,6 +172,7 @@ void defos_toggle_maximized()
void defos_set_console_visible(bool visible)
{
dmLogInfo("Method 'defos_set_console_visible' is not supported in Linux");
}
bool defos_is_console_visible()
@ -264,7 +264,13 @@ bool defos_is_cursor_clipped()
void defos_set_cursor_locked(bool locked)
{
XEvent event;
XPeekEvent(disp, &event);
if(event.type == LeaveNotify)
{
dmLogInfo("hehehe");
}
}
bool defos_is_cursor_locked()
@ -273,6 +279,7 @@ bool defos_is_cursor_locked()
}
void defos_update() {
// We have to query the event from queue to check events
}

View File

@ -57,25 +57,15 @@ function init(self)
}
if system_name == "Linux" then
-- NOTE: since Defold cannot load resource without extension, we added .l here.
-- NOTE: cursur should be normal x11 cursor file that type is: image/x-xcursor
table.insert(self.cursors, extract_to_savefolder("cursor.l"))
-- NOTE: since Defold cannot load resource without extension, we added .xcur here.
-- NOTE: cursor should be normal x11 cursor file that type is: image/x-xcursor
table.insert(self.cursors, extract_to_savefolder("cursor.xcur"))
end
if system_name == "Windows" then
for i, v in ipairs({"cursor_01.ani", "cursor_02.ani" }) do
-- load source file and write them to save folder, so that we can access them with fullpath
local cursor_resource = resource.load("/resources/"..v)
local raw_bytes = buffer.get_bytes(cursor_resource, hash("data"))
local cursor_path = sys.get_save_file(appname, v)
local f = io.open(cursor_path, "wb")
f:write(raw_bytes)
f:flush()
f:close()
print(cursor_path)
table.insert(self.cursors, cursor_path)
-- load source file and write them to save folder, so that we can access them with fullpath, or you can use bundle_resource
table.insert(self.cursors, extract_to_savefolder(v))
end
end