Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
jayw10990

Custom Cursor Gets Cut Off By Screen

Question

So here is my dilemma, my hand cursor gets cutoff on the left hand side of the menus, i cant for the life of me figure out how to move it to the right, but not have it move to the right when in text message box's, title screens, etc.. heres an image of what im talking about. Any help would be much appreciated.

post-23188-0-47463200-1341427545_thumb.jpg

post-23188-0-32575900-1341427547_thumb.jpg

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

You're obviously using a custom script, and there's not much we can do without it.

Share this post


Link to post
Share on other sites
  • 0

Here is the script, I have been using for the hand

 

 

 

 

# ■ Cursor Script

#------------------

#  Script to display a cursor instead of a highlight box

# by Selwyn

# selwyn@rmxp.ch

#==============================================================================

#==============================================================================

# ■ Cursor_Sprite

#==============================================================================

class Sprite_Cursor < Sprite

#--------------

# ● instances

#--------------

attr_accessor :true_x

attr_accessor :true_y

#--------------

# ● initialize

#--------------

def initialize(x = -0, y = 0)

super()

self.x = @true_x = x

self.y = @true_y = y

self.z = 10000

self.bitmap = RPG::Cache.picture("cursor") rescue Bitmap.new(32, 32)

end

#--------------

# ● update

#--------------

def update

super

if self.y < @true_y

n = (@true_y - self.y) / 1

n = 1 if n == 0

self.y += n

elsif self.y > @true_y

n = (self.y - @true_y) / 1

n = 1 if n == 0

self.y -= n

end

if self.x < @true_x

n = (@true_x - self.x) / 1

n = 1 if n == 0

self.x += n

elsif self.x > @true_x

n = (self.x - @true_x) / 1

n = 1 if n == 0

self.x -= n

end

end

end

#==============================================================================

# ■ Window_Selectable

#==============================================================================

class Window_Selectable < Window_Base

#--------------

# ● instances

#--------------

attr_accessor :cursor

alias initialize_cursor initialize

alias update_cursor_moves update

alias dispose_cursor dispose

#--------------

# ● initialize

#--------------

def initialize(x, y, width, height)

initialize_cursor(x, y, width, height)

@cursor = Sprite_Cursor.new(x, y)

update_cursor

end

#--------------

# ● x=

#--------------

def x=(x)

super

@cursor.x = x if !@cursor.nil?

end

#--------------

# ● y=

#--------------

def y=(y)

super

@cursor.y = y if !@cursor.nil?

end

#--------------

# ● visible=

#--------------

def visible=(visible)

super

if !@cursor.nil? and visible == false

@cursor.visible = false

end

end

#--------------

# ● dispose

#--------------

def dispose

dispose_cursor

@cursor.dispose

end

#--------------

# ● update_cursor_rect

#--------------

def update_cursor_rect

if @index < 0

self.cursor_rect.empty

return

end

row = @index / @column_max

if row < self.top_row

self.top_row = row

end

if row > self.top_row + (self.page_row_max - 1)

self.top_row = row - (self.page_row_max - 1)

end

cursor_width = self.width / @column_max - 32

x = @index % @column_max * (cursor_width + 32)

y = @index / @column_max * 32 - self.oy

self.cursor_rect.set(x, y, cursor_width, 32)

end

#--------------

# ● update_cursor

#--------------

def update_cursor

@cursor.true_x = self.cursor_rect.x + self.x + 16

@cursor.true_y = self.cursor_rect.y + self.y + 16

@cursor.update

@cursor.visible = (self.visible and self.index >= 0)

end

#--------------

# ● update

#--------------

def update

update_cursor_moves

update_cursor

end

end

Edited by jayw10990

Share this post


Link to post
Share on other sites
  • 0

The x and y values used for a normal cursor assume it is the far left-upper corner of the image. Your cursor is meant to be to the left of the item, instead of on it. You have a few simple options that may let you get away with not editing a bunch of scripts.

 

1. Change the image, add blank pixels to the left side of it.

2. Change the ox and oy of the cursor sprite.

Share this post


Link to post
Share on other sites
  • 0

thanks for the reply foreverzero, i tried changing the x and y 0's but the cursor just didnt move at all, i did make a new image with 32 extra pixels to the left. On the menu screen next to the actors it did put it in the right place, but at the same time, on the command menu it puts the cursor to far to the right, covering up the words. Any other ideas I may try ?

post-23188-0-85137600-1341442553_thumb.jpg

Edited by jayw10990

Share this post


Link to post
Share on other sites
  • 0

Modify the values in "update_cursor_rect" of the Window_MenuStatus script. The cursor behaves differently in that Window than anywhere else.

 

 

 #--------------------------------------------------------------------------
 # * Cursor Rectangle Update
 #--------------------------------------------------------------------------
 def update_cursor_rect
   if @index < 0
  self.cursor_rect.empty
   else
  self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
   end
 end

Share this post


Link to post
Share on other sites
  • 0

Thankyou Zero, that did work just the way I wanted, I noticed, that pretty much any window that I have a cursor selecting things, will have to have a similar "Rectangle Update" code put into it, to get everything to work the same... pain in the butt, but its worth it. Thanks again. Im sure ill be back on here needing more help soon ><

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...