How do i modify the menu UI

1 Replies • 350 Views

i'm trying to add text to the system UI but i dont seem to have a grasp as to how, since system UI doesnt access spritestack i try to refer it to a UI system like this
module GamePlay
 
  class Menu < BaseCleanUpdate::FrameBalanced
   def create_graphics
      create_viewport
      create_background
      create_buttons
      init_entering
     create_moneyTP
    end
 
   def create_moneyTP
     @tp=UI::PSDKTPMoney.new
   end
 
  end end


and then make
module UI
 
  class PSDKTPMoney < SpriteStack
      
   
    def initialize
    add_text(0, 32, 320, 10, "idk", 0, 1)
   
  end
  end end

but i always get a nil cant be coerced into integer error and basically im completely lost

Aerun

Modérateur

Please make sure to send a full screenshot of your error window.  :)

1. Please make sure to check that tutorial made by Nuri Yuri:



2. Please make sure to always check how are made the PSDK UIs to understand how it works.
When you create a SpriteStack, you have to initialize it with some arguments. For a SpriteStack, you need at least the viewport.
For example with the GTS Button:

Viewport is given with x, y, and an empty variable called name.
You always need to use
super(viewport, x, y)
when you create a SpriteStack ("< SpriteStack") because it needs those arguments to be initialized.
super(xxxxx) is a way to send the variables to the Parent Class (here SpriteStack).
You should always check the PSDK documentation when you work on the code: https://psdk.pokemonworkshop.com/yard/UI/SpriteStack.html#initialize-instance_method

There was an error while thanking
Thanking...