I need to add the names of the players in of my game in my gui.

Okay so I am trying to use the input function.......
%x=input('Put the name of player 1:')
and then
set(handles.uipanel1,'title','x')
%assuming I want to change panel 1's title to the players name..... When I enter the name for player 1 in the comand window it says undefined function or variable......
Any suggestions??

 採用された回答

Paulo Silva
Paulo Silva 2011 年 9 月 8 日

0 投票

x=input('Put the name of player 1:','s'); %choose input as string
set(handles.uipanel1,'title',x) %set the value of x as title

3 件のコメント

Zayne
Zayne 2011 年 9 月 8 日
Thanks for all your help!!!I've got a last question....
I have loaded a snakes and ladders board on axes 1....but now I have to show that something is moving on the board...how can I do that??
I know that I must sumhow hold the image of the board an then disp another image on the same axes,and then to move the object,I need to put in the coordinates,but how do I know what to use??
Paulo Silva
Paulo Silva 2011 年 9 月 8 日
If one axes is on hold you can add many objects to it, they become children of that axes, use the line function to draw something
h=line(...
if you want to just move the line
set(h,'XData',newXdata,'YData',newYdata)
Walter Roberson
Walter Roberson 2011 年 9 月 8 日
As this is image on image, to move one of the images, set() the XData and YData property for it. See the documentation for the image() function.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by