Aizzah wrote:...I want to make image below to be my main menu background, But it did not work. I was thought that my code wasn't right. But there was nothing any error with my game and my picture's name was right. Does anyone know how to fix it?
The problem is in how you are
declaring your Background Images.
The Main Menu background, all of the Save/Load backgrounds, and the Preferences background are normally set as Color Number in
options.rpy.
Code: Select all
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "#F7F7FA",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "#F7F7FA",
The way you change this to an
image, is by going into
script.rpy and declaring
gm_root and
mm_root as an image, (just like all your other images.):
Code: Select all
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
image mm_root = "mm_root.jpg"
image gm_root = "gm_root.jpg"
Then change the entry in
option.rpy, like so: (
Don't forget the COMMA at the end!)
Code: Select all
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "bg_mm",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "bg_gm",
This should fix your problem.
-- Unless you're using a
Main Menu SCREEN.
If you are using a Main Menu Screen, the the problem is:
-- Your GROUND image is Covering your Hotspot Menu.
The FIX is this:
-- In
screens.rpy:
Code: Select all
##############################################################################
# Main Menu
# Note: In general, don't use ShowMenu() to show "screens" other than
# menu screens ("save", "load", etc). Just use a plain Show(). If you're
# showing Labels though, that's different.
screen main_menu:
tag menu
window:
style "mm_root"
#This is your Main Menu IMAGE.
imagemap:
ground "ui/mm_ground.png"
# THIS is your Special main menu Background image,
# or the Special Text meant to appear Over the Main Menu image.
idle "ui/mm_idle.png"
# THIS is your buttons when Not Selected
hover "ui/mm_hover.png"
# THIS is your buttons when cursor Hovers over buttons.
alpha False
# This allows Transparent backgrounds to be Invisible to the Mouse.
# Your Hot Spot coordinates.
hotspot (827, 74, 107, 77) action Start()
hotspot (815, 155, 140, 57) action ShowMenu("load")
hotspot (795, 221, 173, 81) action ShowMenu("preferences")
hotspot (830, 443, 107, 65) action Help()
hotspot (827, 515, 110, 59) action Quit(confirm=False)
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"