Jump to content
lazyV

Show picture using script

Recommended Posts

ok, so i want to show a picture using script, but i want it to show realative to the position of my character. so i tried this but i am not so goot at scripting.

 

 

screen.pictures[1]show(walkable.png, upperleft, (game_player.x)*32, ((game_player.y)*32)-32, 0, 0, 100, normal)
 
isnt it supposed to show 1 tile below the character now?
 
 
 
                     -lazyV

Share this post


Link to post
Share on other sites

Getting $game_player.x and y in that plan will not work if the map is larger than the screen size. And pictures will move with the map so not sure if those things will affect what you are trying to do. You are also showing the picture at 0% width and height there as well as a few other things that would make it not work.

 

Try something like this:

screen.pictures[1].show("walkable.png", 1, $game_player.screen_x, $game_player.screen_y + 32, 100, 100, 255, 0)

What each part means:

screen.pictures[id].show("Image Name", position topleft (0) or center (1), screen x, screen y, width %, height%, opacity (0-255), blend type (0-2))
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks! there was one error but it was just that you had to put "(" and ")" around  $game_player.screen_y + 32

 

 

thank you so much!

Share this post


Link to post
Share on other sites

You don't need brackets around that. The only error I can think of is the separation of lines in an script script box causing it without brackets. But if you got it working, cool - closing.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted