Particles and Resizing

● ARCHIVED · READ-ONLY
Started by Dacuna 6 posts View original ↗
  1. Hi, I'm using "MOG - Animated Title A" for particles, and "Yanfly Engine Ace - Ace Core Engine" for screen resizing.

    Apparently my particles go up right to the normal screen size, then suddenly cut off because the script doesn't know the screen is resized.

    Is there a line in the script that tells it where to dissapear?

    Please ask if you need any more details.

    Thanks!
  2. Please link to the scripts you're using, that will help people find the answers faster.
  3. Ok, goto the Particle Class and in the Initialize Method change this

     def initialize(viewport = nil)
          super(viewport)
          self.bitmap = Cache.title2("Particle")
          self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
          self.blend_type = PARTICLE_BLEND_TYPE
          @cw = self.bitmap.width
          @ch = self.bitmap.height
          @nx = PARTICLE_MOVEMENT_RANGE_X
          @ny = PARTICLE_MOVEMENT_RANGE_Y
          reset_setting
      end

    TO THIS

    def initialize(viewport = nil)
          super(viewport)
          self.bitmap = Cache.title2("Particle")
          self.ox = (self.bitmap.width/2)     #############
          self.oy = (self.bitmap.height/2)    ############
          self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
          self.blend_type = PARTICLE_BLEND_TYPE
          @cw = self.bitmap.width
          @ch = self.bitmap.height
          @nx = PARTICLE_MOVEMENT_RANGE_X
          @ny = PARTICLE_MOVEMENT_RANGE_Y
          reset_setting
      end

    Then  in Reset Setting change this

    def reset_setting
          zoom = (50 + rand(100)) / 100.1
          self.zoom_x = zoom
          self.zoom_y = zoom
          self.x = (rand(576) -32)
          self.y = rand(448 + @ch)
          self.opacity = 0
          self.angle = rand(360)
          nx2 = rand(@nx).abs
          nx2 = 1 if (@nx != 0 and nx2 < 1)      
          @speed_x = @nx > 0 ? nx2 : @nx < 0 ? -nx2 : 0        
          ny2 = rand(@ny).abs
          ny2 = 1 if (@ny != 0 and ny2 < 1)      
          @speed_y = @ny > 0 ? ny2 : @ny < 0 ? -ny2 : 0   
          @speed_a = [[rand(PARTICLE_ANGLE_RANGE), PARTICLE_ANGLE_RANGE].min, 0].max
      end

    TO THIS

    def reset_setting
          zoom = (50 + rand(100)) / 100.1
          self.zoom_x = zoom
          self.zoom_y = zoom
          self.x = rand(Graphics.width)                                      ####
          self.y = rand(Graphics.height + self.bitmap.height) ####
          self.opacity = 0
          self.angle = rand(360)
          nx2 = rand(@nx).abs
          nx2 = 1 if (@nx != 0 and nx2 < 1)      
          @speed_x = @nx > 0 ? nx2 : @nx < 0 ? -nx2 : 0        
          ny2 = rand(@ny).abs
          ny2 = 1 if (@ny != 0 and ny2 < 1)      
          @speed_y = @ny > 0 ? ny2 : @ny < 0 ? -ny2 : 0   
          @speed_a = [[rand(PARTICLE_ANGLE_RANGE), PARTICLE_ANGLE_RANGE].min, 0].max
      end

    Then in Can Reset Setting change this

    def can_reset_setting?
          return true if (self.x < -48 or self.x > 592)    
          return true if (self.y < -48 or self.y > 464)
          return false
      end  
    end

    TO THIS

    def can_reset_setting?
          return true if (self.x < -48 or self.x > 640)    
          return true if (self.y < -48 or self.y > 480)
          return false
      end  
    end

    Then in Create Light change this

     def create_light
          return unless PARTICLE
          @viewport_light = Viewport.new(-32, -32, 600, 480)
          @viewport_light.z = 50
          @light_bitmap =[]
          for i in 0...20
              @light_bitmap.push(Particle_Title.new(@viewport_light))
          end  
      end

    TO THIS

     def create_light
          return unless PARTICLE
          @viewport_light = Viewport.new(0, 0, Graphics.width, Graphics.height) ####################
          @viewport_light.z = 50
          @light_bitmap =[]
          for i in 0...20
              @light_bitmap.push(Particle_Title.new(@viewport_light))
          end  
        end

    Well I think that is all of it hope that helps.
  4. It worked!

    Thank you so much!

    It looks a lot better now.
  5. Glad to help!

    Happy Game Making. BD