Thank you for your Reply modern algebra.
I gave it a go, but I think that my own calculations for it are slightly off.
While it works for 3 and 4 plates it starts to go over the limit at 6 plates.
I made an example using a simple sprite to represent the plate and borders.
#==============================================================================
# ** Square Sprite
#------------------------------------------------------------------------------
# Testing Sprite
#==============================================================================
class Square_Sprite < Sprite
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(nil)
# Make Bitmap
self.bitmap = Bitmap.new(32, 32)
self.bitmap.fill_rect(0, 0, 32, 32, Color.new(0, 255, 0, 255))
self.bitmap.clear_rect(1, 1, 30, 30)
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
super
end
end
# Background Sprite
@background = Sprite.new
@background.bitmap = Bitmap.new(544, 416)
# Draw Borders
@background.bitmap.draw_text(190, 0, 32, 416, "0", 1)
@background.bitmap.fill_rect(222, 0, 1, 416, Color.new(255, 0, 0, 255))
@background.bitmap.fill_rect(322, 0, 1, 416, Color.new(255, 0, 0, 255))
@background.bitmap.draw_text(325, 0, 50, 416, "100", 1)
# Plates Array
@plates = []
# Max Number of plates
plate_n = 5
for i in 0...plate_n
# Make Plate Sprite
@plates[i] = Square_Sprite.new
@plates[i].x = 222 + i * (32 - ((plate_n * 32) - 100) / (plate_n-1))
@plates[i].y = 200 + i
end
loop do
# Update Graphics
Graphics.update
end
This is the line to change the number of plates to center around point A and B.
plate_n = 5