This will allow you to create a Command Window that uses a cursor (or pointer whatever you want to call it) instead of a selector around the text. Of course you can also create a normal menu using this as well.
First of all, import this into the icons folder. (make the background transparent...)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi9.photobucket.com%2Falbums%2Fa57%2Ftsunokiette%2Fhand.png&hash=04fea0340f30094bf53df46c895c3e81d32dde1e)
Then place this with all the other Window Scripts
# ==============================
# * Cursor Command *
# ------------------------------
# Version 1
# 01.07.06
# ------------------------------
# Tsunokiette (Give credit)
# ==============================
class Cursor_Command < Window_Base
def initialize(width, commands, pointer = false)
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
@pointer = pointer
self.contents = Bitmap.new(width - 32, @item_max * 32)
refresh
self.index = 0
end
def refresh(index = 0)
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
if @pointer == true
draw_pointer(index)
end
end
def draw_pointer(index)
rect2 = Rect.new(0, 32 * index + 4, 24, 24)
self.contents.fill_rect(rect2, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon('hand')
self.contents.blt(0, 0, bitmap, rect2)
end
def draw_item(index, color)
self.contents.font.color = color
if @pointer == true
rect1 = Rect.new(24, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect1, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect1, @commands[index],1)
else
rect1 = Rect.new(0, 32 * index, self.contents.width, 32)
self.contents.fill_rect(rect1, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect1, @commands[index],1)
end
end
def disable_item(index)
draw_item(index, disabled_color)
end
def update_cursor_rect
if @index < 0 or @pointer == true
self.cursor_rect.empty
return
end
x = 0
y = 32 * @index
cursor_width = self.contents.width
self.cursor_rect.set(x, y, cursor_width, 32)
end
alias :original_update :update
def update
if @pointer == true
refresh(@index)
end
original_update
end
end
To create a nomal menu do this-
@menu = Cursor_Command.new(width,[commands])
To create a menu using the pointer (cursor) do this-
@menu = Cursor_Command.new(width,[commands],true)
If you get an error tell me immediately, it's a simple script so if it has any errors, it shouldn't be too hard to fix
Cool thing Tsukionette!!! That
Quote@menu = Cursor_Command.new(width,[commands],true)
where do I add this?
Quote from: Tsunokiette on January 07, 2006, 09:01:59 PM
This will allow you to create a Command Window that uses a cursor (or pointer whatever you want to call it) instead of a selector around the text. Of course you can also create a normal menu using this as well.
is there a way to make there be no cursor? just get rid of the stupid box for some menus.....?
I'm not sure what you mean. Do you mean the default cursor? (The selection box that highlights the options)
It's like a 5 second edit, but why would you want to do that? You need to have some sort of indication that the option is selected.
If you're talking about getting rid of it when the pointer (or whatever) is being used, that already happens.
Quote from: Tsunokiette on March 07, 2008, 04:53:42 PM
I'm not sure what you mean. Do you mean the default cursor? (The selection box that highlights the options)
It's like a 5 second edit, but why would you want to do that? You need to have some sort of indication that the option is selected.
Yes i want to get rid of the selection box, i will have a way of showing what is selected, but the window has a special set-up, which makes the selection boxes not line up properly, so i would like to get rid of them entirely.
Quote from: atracious on March 07, 2008, 10:30:57 PM
Yes i want to get rid of the selection box, i will have a way of showing what is selected, but the window has a special set-up, which makes the selection boxes not line up properly, so i would like to get rid of them entirely.
M'kay.
Just add this into your window code -
def update_cursor_rect
self.cursor_rect.empty
end
thanks that did the trick! :)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg138.imageshack.us%2Fimg138%2F1080%2Fzzzir1.jpg&hash=18b9cf8fcd75579e9713e6474645a7b3b90351f7)
;9 i put the "window_script" above "main"
and, where to put this command ?
@menu = Cursor_Command.new(width,[commands],true)[
Quote from: vath on March 12, 2008, 02:59:12 PM
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg138.imageshack.us%2Fimg138%2F1080%2Fzzzir1.jpg&hash=18b9cf8fcd75579e9713e6474645a7b3b90351f7)
;9 i put the "window_script" above "main"
and, where to put this command ?
@menu = Cursor_Command.new(width,[commands],true)[
My post got screwed somehow. Anyways, find line 35 and delete the second ")" that's there. It shouldn't be there.
And you put
@menu = Cursor_Command.new(width,[commands],true)In the same place you would put a normal command window. In fact you should be able to just change the first part to Cursor_Command.new and add ",true" to the end.
Sory but i can't see the demo, who can help me please ?? upload it to mediafire.com for me, thousand thanks :lol: