CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

RPG Maker XP : ondulation d'image ?

mushroompost
mushroompost
Niveau 8
16 janvier 2007 à 11:25:25

Comment permettre une ondulation d´image, par l´intermédiaire de script ?

Un autre topic ait déjà créé à ce sujet, mais aucune réponse n´a été faite.

Merci d´avance.

mushroompost
mushroompost
Niveau 8
16 janvier 2007 à 11:53:12

Le seul script dont j´ai connaissance, faisant mention d´une ondulation est celui-ci :

class Image_onde_xy
attr_accessor :x
attr_accessor:y
attr_accessor :op
attr_accessor:ampl
attr_accessor:puls
attr_accessor:angle
attr_accessor:blend
attr_accessor:img, :va ,:t
def initialize(x,y,nom,ampl=40,puls=4,pas=3,blend=0)
@t=0
@pas=pas
@ampl=ampl
@puls=puls
@op=255
@angle=0
@blend=blend
@va=0
@x=x
@y=y
@nom=nom
if nom .is_a?(String)
@bitsav = RPG::Cache.picture(@nom)
@img=Sprite.new
@img.bitmap=RPG::Cache.picture(@nom)
else
@bitsav = nom
@img=Sprite.new
@img.bitmap=nom

end
@img.blend_type=@blend
@img.opacity=0
super()
maj
end

def dispose
@img.bitmap.dispose
end

def maj
@t+=1

  1. @angle+=@va
  2. @img.angle=@angle

@img.opacity=@op
if @nom .is_a?(String)
@bitsav = RPG::Cache.picture(@nom)
@img.bitmap=RPG::Cache.picture(@nom)

else
@bitsav = @nom
@img.bitmap=@nom

end
@img.x =@x
@img.y =@y
@img.z=100

  1. @img.bitmap=RPG::Cache.picture(@nom)

if @nom .is_a?(String)
@img.bitmap=RPG::Cache.picture(@nom)
else
@img.bitmap=@nom
end
@img.ox = @img.bitmap.width / 2
@img.oy = @img.bitmap.height / 2
@img.z=55
w=@img.bitmap.width
h=@img.bitmap.height
pas=@pas
ampl=@ampl
puls=@puls
puls=puls.to_f
pas=pas.to_f
rect=[]
max=(w/pas)
for i in 0..max
rect[i]=Rect.new(i*pas,0, pas,h)
end
@img.bitmap=Bitmap.new(w,h+2*ampl)
@img.y-=ampl
for i in 0..max

@img.bitmap.blt(i*pas,ampl*(1+Math.sin((@t-i)/(pul
s*pas))),@bitsav, rect[i])
end

@bitsav=@img.bitmap
w=@img.bitmap.width
h=@img.bitmap.height
rect=[]
max=(h/pas)
for i in 0..max
rect[i]=Rect.new(0,i*pas, w, pas)
end
@img.bitmap=Bitmap.new(w+2*ampl,h)
@img.x-=ampl
for i in 0..max

@img.bitmap.blt(ampl*(1+Math.sin((@t-i)/(puls*pas)
)),i*pas,@bitsav, rect[i])

end
end
end

$imgonde=Image_onde_xy.new(position_x,position_y,"
nom de l´image sans l´extension mais entre guillemets")

reste un truc à faire: mettre à jour l´image chaque seconde.

if $imgonde.is_a?(Image_onde_x) or $imgonde.is_a?(Image_onde_y) or $imgonde.is_a?(Image_onde_xy)
$imgonde.maj
end
end

Soit vous mettez ça dans un event en processus parallèle sur votre carte, soit dans Scene_map, dans la fonction update, juste en dessous du "loop do".

Mais je ne comprends rien :fou:

Sous forums
  • Aide à l'achat Mac
  • Steam Deck
  • Création de sites web
  • Création de Jeux
  • Linux
  • Programmation
  • Internet
  • Macintosh
  • Hardware
La vidéo du moment