◆Comment:Picture Preload to fix stutter.
◆Show Picture:#1, Page1, Upper Left (0,0), (100%,100%), 0, Normal (Opacity0 so its transparent)
◆Show Picture:#2, Page2, Upper Left (0,0), (100%,100%), 0, Normal
◆Show Picture:#3, Page3, Upper Left (0,0), (100%,100%), 0, Normal
◆Wait:1 frame
◆Erase Picture:#1
◆Erase Picture:#2
◆Erase Picture:#3
◆Comment:-------------------------------------------
◆Comment:Open Journal Code Block
◆Show Picture:#1, Opened Book, Upper Left (0,0), (100%,100%), 255, Normal
◆If:Switch22 Blank Journal until... is OFF
◆Control Switches:#0024 Switch Page 1 unlocked? = ON
◆Control Variables:#0004 Variable4 Page Number = 1
◆Control Variables:#0027 Variable for Last drawn page = 0
◆
:Else
◆Comment:Start Page when Switch22 is On: (Page needs to be unlocked)
◆Control Switches:#0024 Switch Page 1 unlocked? = OFF
◆Control Switches:#0025 Switch Page 2 unlocked? = ON
◆Control Variables:#0004 Variable4 Page Number = 2
◆Control Variables:#0027 Variable for Last drawn page = 0
◆
:End
◆Comment:The Loop keeps this Eventpage running until we break/end it.
◆Loop
◆Comment:Turn Page Left/Right Code Block
◆Control Variables:#0026 Var Calculation helper = 0
◆If:Button [Left] is pressed down
◆Control Variables:#0026 Var Calculation helper = -1
◆
:End
◆If:Button [Right] is pressed down
◆Control Variables:#0026 Var Calculation helper = 1
◆
:End
◆If:Var Calculation helper = 0
◆Control Variables:#0028 Timer for Button Wait = 0
◆
:End
◆If:Button [Cancel] is pressed down
◆Comment:Insert your Code for closing the Menu and break the Loop
◆Erase Picture:#1
◆Erase Picture:#2
◆Break Loop
◆
:End
◆Label:Run again
◆Control Variables:#0004 Variable4 Page Number += Var Calculation helper
◆If:Variable4 Page Number = 0
◆Comment:When 1 less than first Page, jump to last Page.
◆Control Variables:#0004 Variable4 Page Number = 3
◆
:End
◆If:Variable4 Page Number = 4
◆Comment:When 1 more than last Page, jump to first Page.
◆Control Variables:#0004 Variable4 Page Number = 1
◆
:End
◆Comment:Pictures will only Update if the current Page Number is
: :not equal to the previous shown one.
◆If:Variable4 Page Number ≠ Variable for Last drawn page
◆Control Variables:#0027 Variable for Last drawn page = Variable4 Page Number
◆Comment:Lets check if the next Page is unlocked, else lets jump to label and check
: :the next upper or lower page until we found a unlocked one.
◆If:Variable4 Page Number = 1
◆If:Switch Page 1 unlocked? is ON
◆Play SE:Book1 (90, 100, 0)
◆Comment:Picture with Text for Page 1
◆Show Picture:#2, Page1, Upper Left (0,0), (100%,100%), 255, Normal
◆
:Else
◆Jump to Label:Run again
◆
:End
◆
:End
◆If:Variable4 Page Number = 2
◆If:Switch Page 2 unlocked? is ON
◆Play SE:Book1 (90, 100, 0)
◆Comment:Picture with Text for Page 2
◆Show Picture:#2, Page2, Upper Left (0,0), (100%,100%), 255, Normal
◆
:Else
◆Jump to Label:Run again
◆
:End
◆
:End
◆If:Variable4 Page Number = 3
◆If:Switch Page 3 unlocked? is ON
◆Play SE:Book1 (90, 100, 0)
◆Comment:Picture with Text for Page 3
◆Show Picture:#2, Page3, Upper Left (0,0), (100%,100%), 255, Normal
◆
:Else
◆Jump to Label:Run again
◆
:End
◆
:End
◆Comment:---------------------------------------------------------------------------
: :If you create new Pages, put them above this.
: :I reworked the code to make it easier to add more pages, hope it worked =)
: :---------------------------------------------------------------------------
◆If:Choose your Button pres style is ON
◆Comment:This is the Wait for the Button press after Page changing.
◆Wait:12 frames
◆
:Else
◆Comment:This detects every single button press, for ultra responsive/fast page changing.
: :And extra long press function. just test it.
◆Loop
◆If:Timer for Button Wait ≥ 40
◆Wait:6 frames
◆Break Loop
◆
:Else
◆Control Variables:#0028 Timer for Button Wait += 1
◆
:End
◆If:Button [Left] is pressed down
◆Wait:1 frame
◆
:Else
◆If:Button [Right] is pressed down
◆Wait:1 frame
◆
:Else
◆Break Loop
◆
:End
◆
:End
◆
:Repeat Above
◆
:End
◆
:End
◆Comment:The main Loop needs a Wait 1 Frame to prevent an Endless loop which
: :would Lag or Freeze the Game.
◆Wait:1 frame
◆
:Repeat Above