I've been trying to keep myself busy seeing I'm sick, I tried doing all sorts of things but its too boring...anyways I was looking at all the scripts I made and then this idea just popped in my head.
I want to make a tileset creator. You import pictures and stuff into the pictures folder, use this command window showing all the options, you click one of your pictures, then you drag it on a layed out tileset sheet. I think its a great idea but I'm missing a few things. Mouse script and a resolution script (for larger tileset)
Okay so I found this resolution script but I dont really understand how to use it..maybe you guys can help me with it.
#==============================================================================
# ■ Resolution
#------------------------------------------------------------------------------
# created by Selwyn
# selwyn@rmxp.ch
#
# released on the 19th of June 2006
#
# allows to change the game window's resolution to 800 by 600.
#==============================================================================
module Resolution
#--------------------------------------------------------------------------
# ● instance variables
#--------------------------------------------------------------------------
attr_reader :state
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize
title = "\0" * 256
Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L').call("Game", "Title", "", title, 256, ".\\Game.ini")
title.delete!("\0")
@set_resolution = Win32API.new('Display.dll', 'SetResolution', 'III', 'I')
@set_window_long = Win32API.new('user32', 'SetWindowLong', 'LIL', 'L')
@set_window_pos = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')
@gsm = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
@gcr = Win32API.new('user32', 'GetClientRect', 'LP', 'I')
@kbe = Win32API.new('user32', 'keybd_event', 'LLLL', '')
@gaks = Win32API.new('user32', 'GetAsyncKeyState', 'L', 'I')
@window = Win32API.new('user32', 'FindWindow', 'PP', 'I').call("RGSS Player", title)
@default_size = size
if size[0] < 800 or size[1] < 600
print("A minimum screen resolution of [800 by 600] is required in order to play #{title}")
exit
end
@state = "default"
self.default
end
#--------------------------------------------------------------------------
# ● fullscreen
#--------------------------------------------------------------------------
def fullscreen
@default_size = size
@set_window_long.call(@window, -16, 0x14000000)
@set_window_pos.call(@window, -1, 0, 0, 802, 602, 64)
@set_resolution.call(800, 600, 4)
@state = "fullscreen"
end
#--------------------------------------------------------------------------
# ● default
#--------------------------------------------------------------------------
def default
x = @default_size[0] / 2 - 403
y = @default_size[1] / 2 - 316
@set_window_long.call(@window, -16, 0x14CA0000)
@set_window_pos.call(@window, 0, x, y, 808, 627, 0)
@set_resolution.call(@default_size[0], @default_size[1], 0)
@state = "default"
end
#--------------------------------------------------------------------------
# ● trigger?(key)
#--------------------------------------------------------------------------
def trigger?(key)
return @gaks.call(key) & 0x01 == 1
end
#--------------------------------------------------------------------------
# ● private
#--------------------------------------------------------------------------
private :fullscreen
private :default
private :trigger?
#--------------------------------------------------------------------------
# ● size
#--------------------------------------------------------------------------
def size
width = @gsm.call(0)
height = @gsm.call(1)
return width, height
end
#--------------------------------------------------------------------------
# ● change
#--------------------------------------------------------------------------
def change
if @state == "default"
self.fullscreen
else
self.default
end
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
if trigger?(121) # F10
self.change
end
if Input.trigger?(Input::ALT) or Input.press?(Input::ALT)
@kbe.call(18, 0, 2, 0)
end
end
#--------------------------------------------------------------------------
# ● module functions
#--------------------------------------------------------------------------
module_function :initialize
module_function :fullscreen
module_function :default
module_function :trigger?
module_function :size
module_function :change
module_function :update
end
And maybe ideas on a mouse script that detects the holding down of the left button, detects input of both right and left clicks and can detect mouse x and y. So help is appreciated