Plotting multiple png files

6 次查看(过去 30 天)
MF
MF 2017-12-19
I am creating an archery game in which the user aims at balloons moving left to right on the screen. I am having a few issues.
  1. I know how to get a png with its transparency on the figure window, but I don't know how to plot said figure at a specific point in the plot.
  2. I am not sure how to plot multiple png files. There should be multiple balloons on the screen at once but when I try to plot a new one t erases the old, I've tried using hold on.
  3. I can't get the balloons to move left or right to simulate floating.
figure()
axis([0 100 0 100])
hold on
[bird_a,mapa,aData]=imread('1bird.png');
bird_a=flipdim(bird_a,1);
aData=flipdim(aData,1);
fHand=imshow(bird_a);
set(fHand,'XData',[0 pWidth],'YData',[0 pHeight])
set(fHand,'alphaData',aData)
[bird_b,mapb,bData]=imread('2bird.png');
bird_b=flipdim(bird_a,1);
bData=flipdim(bData,1);
fHand=imshow(bird_b);
set(50,50)
set(fHand,'alphaData',bData)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Strategy & Logic 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by