Background won't change

The engine is not working as expected? Documentation is wrong or out of date? Let us know here!
Forum rules
We are not providing support via this forum; it's community-driven. For official support see https://naninovel.com/support/#naninovel-support
Post Reply
VarBet
Posts: 6
Joined: 02 Oct 2022 22:08

Background won't change

Post by VarBet »

Issue is, that if I try to navigate to goto:Main.EnterName, the background doesn't change at all anymore. If I play Main.nani without navigating to Map.nani, the backgrounds change just fine. Also, background doesn't change if I navigate to .Map1 from .Map0 as well. .Map0 's background stays constant

Main.nani

Code: Select all

@printer TMProWide

#Start

@goto Map.Map0

#Intro

@back bg_door id:Home

@choice ClickMe! gosub:MC.Start

Map.nani

Code: Select all

#Map0
@back bg_map id:Map

@choice button:MapButtons/Home pos:500,500 handler:ButtonArea goto:.Map0
@choice button:MapButtons/Shop pos:-400,300 handler:ButtonArea goto:.Map0
@choice button:MapButtons/Home pos:-500,500 handler:ButtonArea goto:.Map1
@choice button:MapButtons/Shop pos:-400,-300 handler:ButtonArea goto:.Map1

@goto .MapNav

#Map1
@back bg_alley id:Alley

@choice button:MapButtons/Home pos:300,300 handler:ButtonArea goto:.Map0
@choice button:MapButtons/Shop pos:-200,100 handler:ButtonArea goto:.Map0
@choice button:MapButtons/Home pos:-100,400 handler:ButtonArea goto:.Map1
@choice button:MapButtons/Shop pos:-600,-200 handler:ButtonArea goto:.Map1

@goto .MapNav

#MapNav

@choice button:MapButtons/Map_00 pos:800,500 handler:ButtonArea goto:.Map0
@choice button:MapButtons/Map_00 pos:855,500 handler:ButtonArea goto:.Map1
@choice button:MapButtons/Map_00 pos:910,500 handler:ButtonArea goto:.Main.Intro
@choice button:MapButtons/Map_00 pos:800,445 handler:ButtonArea goto:.Map3
@choice button:MapButtons/Map_00 pos:855,445 handler:ButtonArea goto:.Map4
@choice button:MapButtons/Map_00 pos:910,445 handler:ButtonArea goto:.Map5
@choice button:MapButtons/Map_00 pos:800,390 handler:ButtonArea goto:.Map6
@choice button:MapButtons/Map_00 pos:855,390 handler:ButtonArea goto:.Map7
@choice button:MapButtons/Map_00 pos:910,390 handler:ButtonArea goto:.Map8

@stop
idaot
support
Posts: 275
Joined: 01 Aug 2020 08:25

Re: Background won't change

Post by idaot »

It is because each background actor (id) spawns their own object, and will be placed in front of the other actor unless a z-position is specified. Use @hide to hide one of the backgrounds.

Post Reply