<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>how to hide mouse pointer</title>
		<link>http://www.allegro.cc/forums/view/588552</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 15 Nov 2006 12:46:11 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>while i am file_select_ex() i am getting a default mouse cusor. How to hid it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (raja peter)</author>
		<pubDate>Tue, 14 Nov 2006 13:18:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>try hidemouse();;)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (piccolo)</author>
		<pubDate>Tue, 14 Nov 2006 13:41:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, that&#39;s very useful. What&#39;s the point in telling someone to try a function that doesn&#39;t exist?</p><p>Anyway, Allegro&#39;s dialog routines always display the mouse cursor, you cannot change that easily (there are workarounds, like removing the mouse driver before displaying the dialog). It&#39;s a bit easier if you&#39;re using your own dialog struct, in which case you can add a function to hide the mouse.<br />However, why do you want to do that? Navigating the file selection box is easier with the mouse than with the keyboard or gamepad. If you don&#39;t want to hide the mouse at all, but want to use your own cursor instead, use set_mouse_sprite().
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Tue, 14 Nov 2006 13:55:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>He ment, &quot;try <span class="source-code"><a href="http://www.allegro.cc/manual/show_mouse" target="_blank"><span class="a">show_mouse</span></a><span class="k2">(</span>NULL<span class="k2">)</span></span>&quot;</p><p>But follow Evert&#39;s instructions.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Tue, 14 Nov 2006 14:04:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>this is the code </p><p>set_mouse_sprite(img);<br />show_mouse(img);<br />scare_mouse();<br />while(1)<br />{<br />draw_sprite(screen,buf,0,0);<br />draw_sprite(buf,img22....<br />...<br />...<br />unscare_mouse();<br />file_select_ex();</p><p>}</p><p>where to put show_mouse()here.</p><p>Also tried scare and unscare. But didn&#39;t work.</p><p>what is the proper order of displaying?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (raja peter)</author>
		<pubDate>Tue, 14 Nov 2006 15:44:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Use the <a href="http://www.allegro.cc/mockup.html">code</a> tags. One mistake I noticed was you&#39;re drawing your buffer to the screen first... That needs to come last in your drawing operations.
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">while</span><span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span>
  logic<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  
  <a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>buffer,img22,...<span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer,<a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,buffer-&gt;w,buffer-&gt;h<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>

<tt>show_mouse(BITMAP*)</tt> tells allegro to draw the mouse to the specified bitmap (default is <tt>BITMAP *screen</tt>) So <tt>show_mouse(NULL)</tt>, as I said earlier, should get rid of it. But you&#39;re unscaring the mouse right before you call <tt>file_select_ex()</tt>. This is exactly what you don&#39;t want to do.</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">while</span><span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span>
...
  <a href="http://www.allegro.cc/manual/scare_mouse" target="_blank"><span class="a">scare_mouse</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/file_select_ex" target="_blank"><span class="a">file_select_ex</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.allegro.cc/manual/unscare_mouse" target="_blank"><span class="a">unscare_mouse</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span> <span class="c">//optional</span>
<span class="k2">}</span>
</pre></div></div><p>

Make sure you&#39;re not manually drawing the mouse to <tt>buffer</tt> or <tt>screen.</tt>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Tue, 14 Nov 2006 16:31:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I usually draw the mouse pointer using draw_sprite at mouse_x, mouse_y.</p><p>Because of not knowing the correct order of these drawings.</p><p>Since the file_select invoked the default mouse pointer extra, I wanted to use the alternative method to draw the invoked mouse with the cursor i use with draw_sprite and hide the one drawn using draw_sprite.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (raja peter)</author>
		<pubDate>Tue, 14 Nov 2006 16:47:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
set_mouse_sprite(img);<br /> show_mouse(img);
</p></div></div><p>Don&#39;t. Ever.</p><p>set_mouse_sprite sets the sprite/bitmap that ALLEGRO will use to draw the mouse. show_mouse sets the bitmap that ALLEGRO draws the mouse_sprite TO.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Since the file_select invoked the default mouse pointer extra, I wanted to use the alternative method to draw the invoked mouse with the cursor i use with draw_sprite and hide the one drawn using draw_sprite.
</p></div></div><p>There really isn&#39;t a way to draw a mouse cursor yourself while the file select dialog is being displayed. Allegro&#39;s gui dialogs run their own event loop, you won&#39;t be able to do anything else while they are displayed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 14 Nov 2006 17:02:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How about <span class="source-code">show_mouse_to_elephant<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span> ... Oh wait.. we are trying to scare the mouse away.. not the elephant :-P
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Dalrymple)</author>
		<pubDate>Wed, 15 Nov 2006 12:46:11 +0000</pubDate>
	</item>
</rss>
