Class: Scene_Shop

Scene_Shop

new Scene_Shop()

The scene class of the shop screen.

Extends

Methods

activateBuyWindow()

Activates the buy window

activateSellWindow()

Activates the sell window
Gets the actor object of the scene
Returns:
TypeDescription
Game_ActorThe scene's actor object
Adds a window to the scene's WindowLayer
NameTypeDescription
windowWindowThe window to add as a child

arePageButtonsEnabled()booleaninherited

Check if page buttons should be enabled
Returns:
TypeDescription
booleanTrue if page buttons should be enabled

buttonAreaBottom()numberinherited

Gets the bottom of the touch UI button area in the scene
Returns:
TypeDescription
numberY Pixel for the cottom coordinate of the button area

buttonAreaHeight()numberinherited

Gets the height of the touch UI button area
Returns:
TypeDescription
numberHeight in pixels of the button area

buttonAreaTop()numberinherited

Gets the top of the touch UI button area in the scene
Returns:
TypeDescription
numberY Pixel for the top coordinate of the button area
Gets the Y pixel of the buttons
Returns:
TypeDescription
numberY Pixel for the top coordinate of the buttons
Gets the rectangle that represents the buy window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the buy window

buyingPrice()number

Determine the shop's price for the item
Returns:
TypeDescription
numberThe price of the item when bought

calcWindowHeight(numLines, selectable)numberinherited

Calculates how many pixels tall a window is
NameTypeDescription
numLinesnumberAmount of text lines in the window
selectablebooleanIf the window is selectable (or inherits from Window_Selectable) or not
Returns:
TypeDescription
numberAmount of pixels tall the window is

categoryWindowRect()Rectangle

Gets the rectangle that represents the category window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the category window

centerSprite(sprite)inherited

Centers a given sprite within the game window
NameTypeDescription
spriteSpriteThe sprite to center
Check if there is a gameover, and go to Scene_Gameover if so

commandBuy()

Handling for when the buy command is selected

commandSell()

Handling for when the sell command is selected

commandWindowRect()Rectangle

Gets the rectangle that represents the command window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the command window
Creates the scene
Create the background image for the scene
Creates the Touch UI buttons

createBuyWindow()

Creates the buy window

createCancelButton()inherited

Creates the cancel button

createCategoryWindow()

Creates the category window

createColorFilter()inherited

Creates the scene's ColorFilter

createCommandWindow()

Creates the command window

createDummyWindow()

Creates a dummy window. This is used to display an empty window before certain windows are activated

createGoldWindow()

Creates the gold window
Create the scene's help window

createNumberWindow()

Creates the number window
Creates the page up/down buttons

createSellWindow()

Creates the sell window

createStatusWindow()

Creates the status window

createWindowLayer()inherited

Create the scene's WindowLayer

currencyUnit()string

Get the currency unit
Returns:
TypeDescription
stringThe currency unit
Destroys the stage

doBuy(number)

Processing for a purchase from the shop
NameTypeDescription
numbernumberThe number of the item being purchased

doSell(number)

Processing for a sale to the shop
NameTypeDescription
numbernumberThe number of the item being sold
Gets the rectangle that represents the dummy window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the dummy window

endNumberInput()

Processing for the end of number input
Try to autosave the game
Fades out the scene and audio
Default speed for a normal fade
Returns:
TypeDescription
numberAmount of frames to fade
Gets the rectangle that represents the gold window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the gold window

helpAreaBottom()numberinherited

Gets the bottom of the help area
Returns:
TypeDescription
numberY Pixel for the bottom coordinate of the help area

helpAreaHeight()numberinherited

Gets the height needed for the help area
Returns:
TypeDescription
numberNumber of pixels tall the help area is
Gets the top of the help area
Returns:
TypeDescription
numberY Pixel for the top coordinate of the help area
Get the Rectangle object that provides the help window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle representing the help window
Initializes the scene

isActive()booleaninherited

Check if scene is active
Returns:
TypeDescription
booleanTrue if the scene is active

isAutosaveEnabled()booleaninherited

Check if autosaving is enabled
Returns:
TypeDescription
booleanTrue if the game can autosave

isBottomButtonMode()booleaninherited

Check if touch UI buttons appear on bottom
Returns:
TypeDescription
booleanTrue if bottom button mode is enabled

isBottomHelpMode()booleaninherited

Check if the help window appears on bottom
Returns:
TypeDescription
booleanTrue if bottom help mode is enabled
Check if scene is busy
Returns:
TypeDescription
booleanTrue if the scene is busy
Check if scene is currently fading the screen
Returns:
TypeDescription
booleanTrue if the scene is fading
Check if scene is ready
Returns:
TypeDescription
booleanTrue if the scene is ready

isRightInputMode()booleaninherited

Check if right input mode is enabled
Returns:
TypeDescription
booleanTrue if right input mode is enabled

isStarted()booleaninherited

Check if scene is started
Returns:
TypeDescription
booleanTrue if the scene is started

mainAreaBottom()numberinherited

Gets the bottom of the main area
Returns:
TypeDescription
numberY Pixel for the bottom coordinate of the main area

mainAreaHeight()numberinherited

Gets the total height of the main area in pixels
Returns:
TypeDescription
numberTotal height of the main area
Gets the top of the main area
Returns:
TypeDescription
numberY Pixel for the top coordinate of the main area

mainCommandWidth()numberinherited

Get the main command width
Returns:
TypeDescription
numberWidth of a main command

maxBuy()number

Determine the maximum number of the item the player can buy
Returns:
TypeDescription
numberThe maximum number of the item the player can buy

maxSell()number

Determine the maximum number of the item the player can sell
Returns:
TypeDescription
numberThe maximum number of the item the player can sell

money()number

Determine the amount of money the player has
Returns:
TypeDescription
numberThe money the player has

needsCancelButton()booleaninherited

Check if the scene should create the cancel button
Returns:
TypeDescription
booleanTrue if there should be a cancel button in the scene

needsPageButtons()booleaninherited

Check if the scene should create the page buttons
Returns:
TypeDescription
booleanTrue if there should be page buttons in the scene
Cycle to the next actor in the menu

numberWindowRect()Rectangle

Gets the rectangle that represents the number window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the number window
Processing for when the scene's actor changes

onAutosaveFailure()inherited

Processing for when an autosave attempt failed

onAutosaveSuccess()inherited

Processing for when an autosave attempt was successful

onBuyCancel()

Handling for cancel input on the buy window
Handling for OK input on the buy window

onCategoryCancel()

Handling for cancel input on the category window

onCategoryOk()

Handling for ok input on the category window

onNumberCancel()

Handling for cancel input on the number window

onNumberOk()

Handling for ok input on the number window

onSellCancel()

Handling for cancel input on the sell window
Handling for ok input on the sell window
Pops the scene to return to the previous scene

prepare(goods, purchaseOnly)

Prepare the shop scene variables
NameTypeDescription
goodsArrayAn array of shop good objects
purchaseOnlybooleanIf the shop only allows buying
Cycle to the previous actor in the menu
Requests an autosave

scaleSprite(sprite)inherited

Scales a given sprite to fit in the game window
NameTypeDescription
spriteSpriteThe sprite to scale
Gets the rectangle that represents the sell window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the sell window

sellingPrice()number

Determine the price the shop will buy the item for
Returns:
TypeDescription
numberThe price the shop will buy the item for

setBackgroundOpacity(opacity)inherited

Set the background image opacity
NameTypeDescription
opacitynumberThe opacity to set the background image to

slowFadeSpeed()numberinherited

Default speed for a slow fade
Returns:
TypeDescription
numberAmount of frames to fade
Starts the scene

startFadeIn(duration, white)inherited

Start to fade the scene in
NameTypeDescription
durationnumberFrames to fade in the scene
whitebooleanIf the fade color is white or not

startFadeOut(duration, white)inherited

Start to fade the scene out
NameTypeDescription
durationnumberFrames to fade out the scene
whitebooleanIf the fade color is white or not

statusWidth()number

Gets the status window's width
Returns:
TypeDescription
numberThe width of the status window

statusWindowRect()Rectangle

Gets the rectangle that represents the status window's x/y/width/height
Returns:
TypeDescription
RectangleThe rectangle that represents the status window
Stops the scene
Terminates the scene
Updates the scene
Sets the actor object of the scene
Updates the scene's children

updateColorFilter()inherited

Updates the scene's ColorFilter
Updates the scene's fade
Updates the page up / down buttons visibility