home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
memory plugin-newbie plugin dev. questions
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="newbie23" data-source="post: 20704" data-attributes="member: 14252"><p>During the last days I have been working on a small plugin that allows you to play the game 'connect four' (try to place four disks of your color on a horizontal, diagonal or vertical row). I have a first version ready (that allows to play human versus human and human versus pc opponent)</p><p></p><p>A small screenshot </p><p></p><p><img src="http://members.lycos.nl/mediaportal/connectfour.jpg" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>I have however some problems.</p><p></p><p>-the board and the buttons to select the columns are created during initialization. The board consists of a twodimensional array of GUIImages. On my development machine it shows correctly, but on my other pc (with release 0.1.3.0) the board is not shown. The buttons on top are created identically and are shown on both machines</p><p></p><p>The code to create the board and buttons is :</p><p></p><p></p><p>[code]</p><p>for (int i=0;i<game.Width;i++) {</p><p> for(int j=0;j<game.Height;j++)</p><p> {</p><p> xpos=xoffset+i*xdistance;//set correct positions</p><p> ypos=yoffset+j*ydistance;</p><p> GUIImage imagetest= new GUIImage(GetID,40, xpos,ypos, 64, 64,boardbg, 0);</p><p> imagetest.AllocResources();</p><p> imageboard[i,j]=imagetest;</p><p> GUIControl aaa=(GUIControl)imagetest ; </p><p> Add(ref aaa);</p><p> }</p><p>}</p><p></p><p></p><p>and </p><p></p><p></p><p>for (int i=0;i<game.Width;i++)</p><p> {</p><p>GUIButtonControl test=new GUIButtonControl(GetID,200+i,xoffset+i*xdistance,yoffset,60,40,"menu_list_focus.png","menu_list_nofocus.png"); </p><p>test.AllocResources();</p><p>GUIControl bbb=(GUIControl)test;</p><p>Add(ref bbb);</p><p> }</p><p></p><p> </p><p>[/code]</p><p></p><p></p><p>The above code is called from the following</p><p>[code]</p><p></p><p>public override bool OnMessage(GUIMessage message) {</p><p>switch ( message.Message )</p><p>{</p><p>case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT </p><p>base.OnMessage(message);</p><p> </p><p> CreateBoard();</p><p>CreateColumnButtons();</p><p> break;</p><p>[/code]</p><p></p><p>Is this the correct way to create the board and visualize it? Why is it not shown on my second pc? Remember that I am quite new to mediaportal,c# and OO-programming, so please provide detailed descriptions. </p><p></p><p>Kind Regards</p></blockquote><p></p>
[QUOTE="newbie23, post: 20704, member: 14252"] During the last days I have been working on a small plugin that allows you to play the game 'connect four' (try to place four disks of your color on a horizontal, diagonal or vertical row). I have a first version ready (that allows to play human versus human and human versus pc opponent) A small screenshot [img]http://members.lycos.nl/mediaportal/connectfour.jpg[/img] I have however some problems. -the board and the buttons to select the columns are created during initialization. The board consists of a twodimensional array of GUIImages. On my development machine it shows correctly, but on my other pc (with release 0.1.3.0) the board is not shown. The buttons on top are created identically and are shown on both machines The code to create the board and buttons is : [code] for (int i=0;i<game.Width;i++) { for(int j=0;j<game.Height;j++) { xpos=xoffset+i*xdistance;//set correct positions ypos=yoffset+j*ydistance; GUIImage imagetest= new GUIImage(GetID,40, xpos,ypos, 64, 64,boardbg, 0); imagetest.AllocResources(); imageboard[i,j]=imagetest; GUIControl aaa=(GUIControl)imagetest ; Add(ref aaa); } } and for (int i=0;i<game.Width;i++) { GUIButtonControl test=new GUIButtonControl(GetID,200+i,xoffset+i*xdistance,yoffset,60,40,"menu_list_focus.png","menu_list_nofocus.png"); test.AllocResources(); GUIControl bbb=(GUIControl)test; Add(ref bbb); } [/code] The above code is called from the following [code] public override bool OnMessage(GUIMessage message) { switch ( message.Message ) { case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT base.OnMessage(message); CreateBoard(); CreateColumnButtons(); break; [/code] Is this the correct way to create the board and visualize it? Why is it not shown on my second pc? Remember that I am quite new to mediaportal,c# and OO-programming, so please provide detailed descriptions. Kind Regards [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
memory plugin-newbie plugin dev. questions
Contact us
RSS
Top
Bottom