RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Cursor Command

0 Members and 3 Guests are viewing this topic.

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
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...)



Then place this with all the other Window Scripts

Code: [Select]
# ==============================
# * 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-

Code: [Select]
@menu = Cursor_Command.new(width,[commands])

To create a menu using the pointer (cursor) do this-

Code: [Select]
@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
« Last Edit: March 12, 2008, 10:04:56 PM by Tsunokiette »
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

****
Rep: +0/-0Level 90
Cool thing Tsukionette!!! That

*
Rep: +0/-0Level 89
Quote
@menu = Cursor_Command.new(width,[commands],true)


where do I add this?
Not Dead...only sleeping...unlucky...

-qoute from fable on tombstone

***
Rep:
Level 88
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.....?
"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
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.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

***
Rep:
Level 88
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.
"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
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 -

Code: [Select]
def update_cursor_rect
self.cursor_rect.empty
end
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

***
Rep:
Level 88
thanks that did the trick! :)
"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html

**
Rep:
Level 86

 ;9 i put the "window_script" above "main"
and, where to put  this command ?
Code: [Select]
@menu = Cursor_Command.new(width,[commands],true)[
« Last Edit: March 12, 2008, 03:04:13 PM by vath »

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude

 ;9 i put the "window_script" above "main"
and, where to put  this command ?
Code: [Select]
@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

Code: [Select]
@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.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

*
Rep: +0/-0Level 85
Sory but i can't see the demo, who can help me please ?? upload it to mediafire.com for me, thousand thanks  :lol: