OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Resizing img inside a div after onTouch without the image bouncing around inside the div

  • Thread starter Thread starter Tyler Bassett
  • Start date Start date
T

Tyler Bassett

Guest
I have a div that holds 2 imgs (Pokemon) when I click on the img I enlarge it so it's apparent which Pokemon I'm switching to. But it jumps around / bounces inside the div making it look not appealing for the game. I use p5.js and have dynamically made the images with onTouch events to resize the image. One issue might be the fact that the pokemon images I use start as different sizes loaded in. Witch I reside the best I can to start around the same size. I'm hoping I can post pictures to show what's going on along side my code. Everything for the game is in 1 html file and 1 js file hopefully making it easy for someone to run and see the problem.

I've tried resizing I've tried setting max-widths + max-heights expecting this to solve the problem of it looking funky when I make the selected pokemon bigger

<p>I have a div that holds 2 imgs (Pokemon) when I click on the img I enlarge it so it's apparent which Pokemon I'm switching to. But it jumps around / bounces inside the div making it look not appealing for the game. I use p5.js and have dynamically made the images with onTouch events to resize the image. One issue might be the fact that the pokemon images I use start as different sizes loaded in. Witch I reside the best I can to start around the same size. I'm hoping I can post pictures to show what's going on along side my code. Everything for the game is in 1 html file and 1 js file hopefully making it easy for someone to run and see the problem.</p>
<p>I've tried resizing I've tried setting max-widths + max-heights expecting this to solve the problem of it looking funky when I make the selected pokemon bigger</p>
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top