Daily Archives

Articles indexed Wednesday July 4 2012

Page 11/17 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Ubuntu 12.04 - no wireless network recognized

    - by Itai
    I just installed Ubntu 12.04 along with WIN7 on the same laptop - Dell Vostro-3560. Now, on Win7 i can access to different wi-fi networks. However, when i am logging onto the Ubuntu section (after re-starting my laptop) - an error message appears: "Disconnected - you are now offline". When i take a look at my network menu (in the upper bar on the screen), i see that no network is found (and i have a few of them in the area...). I tried to look around but really could not find a concrete practical solution to this specific problem, would appreciate any solution from anyone out there that had this problem and solved it. Thanks... Itai

    Read the article

  • Why did this command ":(){ :|: & };:" make my system lag so bad I had to reboot?

    - by blade19899
    Danger! Do not run this command to "test" it unless you are prepared for a crash and/or force-rebooting your system I was in my Virtualbox running 12.04 trying to compile an app, and while waiting I happened to chance upon a forum where a comment said: Try :(){ :|: & };: Fun, too, and doesn't need root. Without thinking I ran it in my gnome-terminal it made my 12.04 virtualbox lag so badly I had to shut it down. My question is what does this command do? :(){ :|: & };:

    Read the article

  • Share home directory between Linux and Windows dual boot

    - by user877329
    This question is somewhat similar to How to use Windows Share has home directory, but in this case Windows is not running. I have installed a dual-boot configuration with Ubuntu 12.04 and Windows. My Windows partition is mounted on /C. Now I want either Ubuntu to locate home directories in /C/Users Which is the location of windows accounts or I want Windows to use D:\home for home directories. (D is the name of the Ubuntu root directory). For the first approach, I have managed to create a test user account test-user:x:1004:1001:Test:/C/Users/test-user:/bin/bash The account works but test-user cannot run any X session. From .xsession-errors chmod: Changing rights on ”/C/Users/test-user/.xsession-errors”: Operation not permitted Would it help get rid of that chmod, which has no effect? How do I? If I use the second approach, I need the Ext2fsd driver, which seems to work, but I am not sure if Windows maps the Ext2 system that early. Here is my fstab proc /proc proc nodev,noexec,nosuid 0 0 UUID=e7cef061-ed8d-4a82-b708-0c8f4c6f297f / ext3 errors=remount-ro 0 1 UUID=2CDCEB43DCEB0644 /C ntfs defaults,umask=007,gid=46 0 0 UUID=b087b5c0-b4bd-47e7-8d34-48ad9b192328 none swap sw 0 0 Update: I found something here: http://www.tuxera.com/community/ntfs-3g-advanced/ Will work if i do a correct mapping between NT users and Linux users.

    Read the article

  • Really slow wireless internet on 12.04 with HP dv6 6070ca

    - by Joe
    I was recently running the previous version of Ubuntu through Wine, and everything was working great. I decided to upgrade to pangolin when I saw it came out. After upgrading the internet was very slow (the estimated time on the updates was something like 4 days). I thought maybe this had something to do with the Wine installation, so I decided to finally do an actual dual boot. I partitioned my drive all nice and neat, but I made the mistake of connecting to the internet for the installation, and clicking the option to install updates and restricted extras. This was in the morning, circa 6 am. Fast forward to the evening, the installation is frozen at around 75%. In frustration I gave the ol girl a hard shut-down, which effectively rendered my machine useless. I used the thumb drive to reinstall Ubuntu, this time without connecting to the internet. Installed nice and easy, no problems, but the internet is still ridiculously slow. It took me about 20 minutes of frustration and hitting stop and reload repeatedly to even get this question page to open. This is important to me as now Windows won't even boot and I have to use ubuntu for the time being but I can't even bear to turn on my laptop due to the frustration that immediately ensues. Please help! Oh, and I'm relatively new so if there are some terminal commands that spew out info you guys would find useful let me know what they are and I'll post back the information.

    Read the article

  • stuck in busybox after update

    - by Lyra500
    I should start out by saying that I am not very tech savvy and have done my best to understand what is going on here from reading other people's posts and have fumbled my way through several attempted fixes without getting anywhere... I run ubuntu 12.04 on an admittedly cheap laptop from ebuyer and in spite of being cheap and not a brand laptop I have never had any major problems with it. Since updating to 12.04 when it was released the boot-up process has always been slow. Logging in takes about 30secs longer than it used to and if I closed my laptop and opened it again instead of being met with a login screen I'd be met with a black screen with a white mouse. As all of these problems had a behavior-changing fix (don't close laptop, patiently wait for login, etc.) I didn't think of reporting any of the issues. Last night when the update manager prompted me that there were updates available I duly did them as I usually do. At the time a bug report came up and I cannot remember what it said but I reported the bug as I was prompted to do. Then this morning when I started up my laptop it went through the usual sequence, GRUB, purple screen with 'ubuntu' etc. and then when it tried to boot up it went into BusyBox and I have not been able to do anything to solve this. I have tried going into the GRUB menu and starting previous versions but I come to the same point - busybox. I have borrowed another rather elderly laptop with Windows Vista to try and download Boot Repair and Ubuntu and burn them onto CD. I tried downloading boot repair five times, to laptop, CD and USB. Every time it would download and burn fine but then the windows laptop would tell me that 1% did not download properly and my laptop would not run the USB or CD upon booting. I then tried to download ubuntu and make a livecd, twice, but again was told that 1% did not download properly and again my laptop will not run ubuntu from the CD upon booting even if/when I went into the f2 menu and changed the menu priority (if that's what you call it) for booting up to make sure it was definitely trying the USB/CD first. This is the message I get from busybox: BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands I have tried 'exit' but it mentions things about 'kernal panic' and 'tried to quit init!' and 'can't find /root/dev/console : no such file'. I know that the problem is probably caused by a problem with a kernal caused by the update last night, but I couldn't honestly tell you exactly what was updated and without being able to boot from a livecd I'm not sure how to go about fixing this. As I said, I am not tech savvy and have done what I can to try and find a solution to the problem but I'm starting to feel like I'm out of options. Does anyone have any ideas?

    Read the article

  • Ubuntu won't wake after pm-suspend

    - by Matus
    i have ubuntu 12.04 on my Zotac AD-02. Problem is when i run pm-suspend. zotac goes to sleep (it shows red led, and green light is flashing) but when i send magic packet to WOL it hangs ... it stops flashing and LED is green as its turned on but SSH wont run and it won't react to mouse or anything. I've read that sometimes it has something to do with graphics. It is mainly for DLNA and PLEX so i don't use any graphic component so if there is the problem tell me how to disable it :) is there some log or anything i can post? im fairly good at bash but not at all in ubuntu or debian. so i can't find any log. Thanks EDIT: here is lscpi if it helps

    Read the article

  • USB Wireless keyboard and wired mouse do not power on at system boot

    - by Victor S
    This did not use to be an issue but, I am not sure why, my USB keyboard and mouse are not powering on after system boot. I can fix the keyboard by taking out and then plugging back in the USB antennae, which makes it work right away, but the mouse, even if I un-plug it and plug it back in, it takes about two-three minutes until it receives any juice and starts working. Any ways I can debug this, or fix it? Thanks!

    Read the article

  • Set nomodeset in usb installation (efi loader with iso)

    - by Garrett
    I'm working with the studyblast solution (http://studyblast.wordpress.com/2011/08/14/guide-mac-os-x-lion-how-to-boot-a-linux-live-system-from-a-usb-drive-how-to-update-any-ocz-ssds-firmware/) to creating a live usb for osx. I managed to get Ubuntu booted but the screen looks like a corrupt/glitch image. I can just about make out the clock on the bottom right and a few icons. I've been told that this is an easy fix and that nomodeset needs to be set for the graphics card but all the solutions i find are for a hard drive installed Ubuntu where you can cd in and edit the grub file - how do you do this is it's in an iso? Thanks Garrett

    Read the article

  • Out of range on shut down, Log Out, Restart and Suspend

    - by user52889
    I have looked extensively on the help forums but haven't found a similar problem. Whether I want to Shut Down, Restart, Log Out or Suspend, as soon as I select my desired option the screen goes black with a message (Out of Range displayed in the middle of the screen. No combination of keys frees the screen and I have to manually hold the power button on my PC to shut it down. There is no problem on start up. My computer is a dual boot with Windows 7.

    Read the article

  • How to protect Ubuntu from fork bomb

    - by dblang
    I heard someone talking about a fork bomb, I did some research and found some dreadful information about some strange looking characters people can have you type at the command line and as a result do bad things on the computer. I certainly would not issue commands I do not understand but one never knows what can happen. I heard that some OS allows the administrator to place some limit on user processes to mitigate the effects of fork bombs, is this protection in Ubuntu by default or would a person with sudo privilege have to set this? If so, how?

    Read the article

  • category title and affect on SEO and ranking

    - by Mark
    We are working on a jobs and skills website (similiar to Skill Pages) and are deciding on categories. Rather than having load of categories like, for example, Builder, Electrician, Carpenter etc, we would like to have one word more general categories. So for example we have House, Computer, Education, Art etc. So a builder would be in category Home and a few others. Will this style negatively effect our SEO and ranking? And if so, should we abandon and go back to traditional categories and sub-categories?

    Read the article

  • Displaying google analytics data on my website

    - by anon-user0
    I sale adspace for my websites directly to the advertisers. I ad page where I want to show google anaylytics information that update automatically without me having to manually update everyday or every month. Something like this: http://wstats.net/en/website/riverplate.com#stat_trafic I don't want to use embedded or iframed third party services. I know google has public API and you can connect it to google graph API to to show pretty graphs. There is a tutorial by google here on how to do it: https://developers.google.com/analytics/resources/articles/gdataAnalyticsCharts Few problems: I don't know much javascript The javascript seems to prompt for authntication as opposed to login automatically. (from my understanding by reading comments on the code) Does anyone know of any ready made script that does what I am looking for or know how I can fix this code that will allow me to display analytic info without authenticating? Thanks.

    Read the article

  • How can I get cross-browser consistent behavior for TR heights within a table with a set height? [migrated]

    - by Dan
    I have an arbitrary number of tables with an arbitrary number of rows in each, and all tables are the same height. My initial approach was to just set the overall height of the table and hope the rows were smart enough to distribute themselves appropriately. That's not the case. I have 4 different behaviors going on with 4 browsers, but I need them to all render at the very least in a similar way. Safari & Chrome (WebKit): All rows are equal height, creating scroll bars as needed and fitting within table height. Firefox: All rows are the height necessary to fit their content, with the remaining rows overflowing out of the table. Additionally, If the content of the rows does not take up all of the height, only the part of the table with content in it takes the background (though it seems, through use of Firebug, that the actual table [and TR] extend to the bottom of the proper table height). IE: All rows are the height necessary to fit their content, with the remaining rows overflowing out of the table. Obviously this only includes one version of each browser and additional variation would likely appear with more being tested. Ideally, a solution where the browser renders TRs with less content smaller than those with larger content, while still using scrolling within the variable height TRs when the overall height of the table is not enough would be optimum. I could potentially see a solution to achieve that with JS, but can it be done with CSS? Or, if not, can the behavior that WebKit displays be made to work across the browsers? Thanks! PS: Example can be found here.

    Read the article

  • SSL Certificate

    - by outdoorcat
    I've received the email below from google about my wordpress site and have no idea how to follow the instructions. Any help out there? Dear Webmaster, The host name of your site, https://www.example.com/, does not match any of the "Subject Names" in your SSL certificate, which were: *.wordpress.com wordpress.com This will cause many web browsers to block users from accessing your site, or to display a security warning message when your site is accessed. To correct this problem, please get a new SSL certificate from a Certificate Authority (CA) with a "Subject Name" or "Subject Alternative DNS Names" that matches your host name. Thanks, The Google Web-Crawling Team

    Read the article

  • IE9 Loses Some CSS After Particular Form Submit [migrated]

    - by Asherion
    The site I am editing has a search form. For the record, there are several other forms on the site, contact and the like. This is the only one with an issue. Upon submission of the form, SOME of the styling is lost in IE9 (possibly other versions of IE, haven't tested that yet). Primarily, the margins and colors set in html and body appear to have been lost. Menus, banner, text, etc all appear to retain styles. All styles are on one sheet, that are used here... Any helpful advice? Here is the contents of the search page and the php used to check for the form, if that helps, and the css that I think is lost. THE HTML: <div id="search"> <br /> <div style="float:right;font-size:.8em;"> <form name="form_sidesearch" action="search.html" method="post"> <input type="hidden" name="action" value="search" /> <input type="text" name="search_value" value="<?php echo $systems_primary->search_value ?>" /> <input type="submit" name="submit_search" value="Search Website" /> </form> <br /> </div> </div> <?php echo stripslashes($search_results); THE PHP: <?php // -- Begin Search -------------------------------------------------------------------------------------- if($_REQUEST["action"] === "search") { if(strlen($_REQUEST["pg"]) <= 0) { $_REQUEST["pg"] = 1; } $search_results = $systems_primary->search_website("index",urldecode($_REQUEST["search_value"]),"<div class=\"listing ui-corner-all\"><a href=\"{ENTRY_URL}\" title=\"{ENTRY_TITLE}\" class=\"listing_title\">{ENTRY_TITLE}</a>{ENTRY_CONTENT} <a href=\"{ENTRY_URL}\" title=\"{ENTRY_TITLE}\" style=\"font-size:.8em;\">...read more</a></div><br /><br />",345,"all",10,$_REQUEST["pg"]); } // -- End Search ---------------------------------------------------------------------------------------- ?> THE LOST CSS (could be more): html { background-color:#F6E6C8; font-size:16px; font:Helvetica; } body { width:1027px; margin:0 auto; background-color:#ffffff; font: arial, times new roman, sans-serif; }

    Read the article

  • Google displaying swf menu in SiteLinks

    - by m90
    I have a website that uses a Flash based menu as its main navigation. A plain HTML fallback version is "lying underneath", the swf is embedded using swfobject. swfobject.embedSWF('MENU.swf', 'menu', '1000', '600', '8.0.0', 'ext/expressInstall.swf', {}, {wmode:'transparent',bgcolor:'#666666'}, {}); Somehow Google now started displaying a link to the swf-file in the SiteLinks (noting [SWF] beforehand) which is pretty ugly as the Flash content gets all scrambled and all you see is a random string of characters and numbers (it looks "hacked" to me, although I do know it is not). Also, the link to the swf is plain useless as it relies on JavaScript-functions in the HTML-document. I already demoted the swf in the Webmaster Tools, yet in some situations the link will still show up. Is anyone aware of this problem (I haven't found too much on this on the Internet) and knows how I can keep the search results from linking to the swf?

    Read the article

  • Help with URL Rewrite

    - by bodesam
    This is the first time i'm doing this and have been doing some research on it. I have a page that selects some info from a database and displays it with a link to a second page that uses the result to query the database, something like this: $sel=mysql_query("select id, title from thetable "); while($row=mysql_fetch_array($sel)) { $id=$row['id']; $title=$row['title']; echo "<a href='more.php?id=$id'>$title</a>"; } The issue is, in the more.php page, instead of more.php?id=5 to show in the address bar, I want something like more/title Secondly, as it obtains in most sites, I want the link on the referring page to show this friendly url on mouse hover not the more.php?id=5 And I notice in most sites some words like 'a', 'and', 'the' etc are usually removed from the url title(even if there originally), moreover how does one handle the situation where more than one record have the same title. How does one go about achieving this url rewrite with htaccess or whatever method is used. Thanks.

    Read the article

  • Apache logs: "::1 ... "OPTIONS * HTTP/1.0" 200 -

    - by Meltemi
    Just looking at logs of a not-so-busy site on one of our Apache servers and notice tons of these in the log: ::1 - - [15/Apr/2011:12:11:40 -0700] "OPTIONS * HTTP/1.0" 200 - ::1 - - [15/Apr/2011:12:11:41 -0700] "OPTIONS * HTTP/1.0" 200 - ::1 - - [15/Apr/2011:12:11:44 -0700] "OPTIONS * HTTP/1.0" 200 - They seem to appear multiple times just below the GET requests where Apache has served a page & its related images. what do they mean? what IP is "::1"? if they're benign can I suppress them?

    Read the article

  • libgdx setOrigin and setPosition not working as expected?

    - by shino
    I create a camera: camera = new OrthographicCamera(5.0f, 5.0f * h/w); Create a sprite: ballTexture = new Texture(Gdx.files.internal("data/ball.png")); ballTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear); TextureRegion region = new TextureRegion(ballTexture, 0, 0, ballTexture.getWidth(), ballTexture.getHeight()); ball = new Sprite(region); Set the origin, size, and position: ball.setOrigin(ball.getWidth()/2,ball.getHeight()/2); ball.setSize(0.5f, 0.5f * ball.getHeight()/ball.getWidth()); ball.setPosition(0.0f, 0.0f); Then render it: batch.setProjectionMatrix(camera.combined); batch.begin(); ball.draw(batch); batch.end(); But when I render it, the bottom left of my ball sprite is at (0, 0), not the center of it, as I would expect it to be because I set the origin to the center of the sprite. What am I missing?

    Read the article

  • "const char *" is incompatible with parameter of type "LPCWSTR" error

    - by N0xus
    I'm trying to incorporate some code from Programming an RTS Game With Direct3D into my game. Before anyone says it, I know the book is kinda old, but it's the particle effects system he creates that I'm trying to use. With his shader class, he intialise it thusly: void SHADER::Init(IDirect3DDevice9 *Dev, const char fName[], int typ) { m_pDevice = Dev; m_type = typ; if(m_pDevice == NULL)return; // Assemble and set the pixel or vertex shader HRESULT hRes; LPD3DXBUFFER Code = NULL; LPD3DXBUFFER ErrorMsgs = NULL; if(m_type == PIXEL_SHADER) hRes = D3DXCompileShaderFromFile(fName, NULL, NULL, "Main", "ps_2_0", D3DXSHADER_DEBUG, &Code, &ErrorMsgs, &m_pConstantTable); else hRes = D3DXCompileShaderFromFile(fName, NULL, NULL, "Main", "vs_2_0", D3DXSHADER_DEBUG, &Code, &ErrorMsgs, &m_pConstantTable); } How ever, this generates the following error: Error 1 error C2664: 'D3DXCompileShaderFromFileW' : cannot convert parameter 1 from 'const char []' to 'LPCWSTR' The compiler states the issue is with fName in the D3DXCompileShaderFromFile line. I know this has something to do with the character set, and my program was already running with a Unicode Character set on the go. I read that to solve the above problem, I need to switch to a multi-byte character set. But, if I do that, I get other errors in my code, like so: Error 2 error C2664: 'D3DXCreateEffectFromFileA' : cannot convert parameter 2 from 'const wchar_t *' to 'LPCSTR' With it being accredited to the following line of code: if(FAILED(D3DXCreateEffectFromFile(m_pD3DDevice9,effectFileName.c_str(),NULL,NULL,0,NULL,&m_pCurrentEffect,&pErrorBuffer))) This if is nested within another if statement checking my effectmap list. Though it is the FAILED word with the red line. Like wise I get the another error with the following line of code: wstring effectFileName = TEXT("Sky.fx"); With the error message being: Error 1 error C2440: 'initializing' : cannot convert from 'const char [7]' to 'std::basic_string<_Elem,_Traits,_Ax' If I change it back to a Uni code character set, I get the original (fewer) errors. Leaving as a multi-byte, I get more errors. Does anyone know of a way I can fix this issue?

    Read the article

  • Software Architecture and Design vs Psychology of HCI class

    - by Joey Green
    I have two classes to choose from and I'm wanting to get an opinion from the more experienced game devs which might be better for someone who wants to be an indie game dev. The first is a Software Architecture and Design course and the second is a course titled Psychology of HCI. I've previously have taken a Software Design course that was focused only on design patterns. I've also taken an Introduction to HCI course. Software Architecture and Design Description Topics include software architectures, methodologies, model representations, component-based design ,patterns,frameworks, CASE-based desgins, and case studies. Psychology of HCI Description Exploration of psychological factors that interact with computer interface usablilty. Interface design techniques and usability evaluation methods are emphasized. I know I would find both interesting, but my concern is really which one might be easier to pick up on my own. I know HCI is relevant to game dev, but am un-sure if the topics in the Software Architecture class would be more for big software projects that go beyond the scope of games. Also, I'm not able to take both because the overlap.

    Read the article

  • Continuous Integration, what are the strategies to manage binary content?

    - by sebas
    Currently we are testing various configurations between Feature Branching and CI with Feature toggling. I can see there are several viable options out there for the code, but I also know that CI totally relies on the possibility to merge the code. So I wonder, how do you manage CI with binary data, like art assets? I can also see another problem: all the code can be tested before to commit, I can even validate the data before to commit, but how can I test the art?! Should I use another methodology for art content?

    Read the article

  • Game thread, render thread, animation/inverse kinematics, and synchronization

    - by user782220
    In a multithreaded setup with a game logic thread and a render thread, with some kind of skin mesh animation with inverse kinematics plus etc how does animation work? Does the game logic thread just update a number saying time T in the animation and then the render thread infers Who owns the skin mesh animation, the game logic thread or the render thread? How is it stored in the scene graph if it is stored there at all? When the game logic updates does it do the computation of the skin mesh animation and the computation of the inverse kinematics and then store the result directly in the scene graph or is it stored indirectly and the render thread does the computation?

    Read the article

  • How do I interpolate air drag with a variable time step?

    - by Valentin Krummenacher
    So I have a little game which works with small steps, however those steps vary in time, so for example I sometimes have 10 Steps/second and then I have 20 Steps/second. This changes automatically depending on how many steps the user's computer can take. To avoid inaccurate positioning of the game's player object I use y=v0*dt+g*dt^2/2 to determine my objects y-position, where dt is the time since the last step, v0 is the velocity of my object in the beginning of my step and g is the gravity. To calculate the velocity in the end of a step I use v=v0+g*dt what also gives me correct results, independent of whether I use 2 steps with a dt of for example 20ms or one step with a dt of 40ms. Now I would like to introduce air drag. For simplicity's sake I use a=k*v^2 where a is the air drag's acceleration (I am aware that it would usually result in a force, but since I assume 1kg for my object's mass the force is the same as the resulting acceleration), k is a constant (in this case I'm using 0.001) and v is the speed. Now in an infinitely small time interval a is k multiplied by the velocity in this small time interval powered by 2. The problem is that v in the next time interval would depend on the drag of the last which again depends on the v of the last interval and so on... In other words: If I use a=k*v^2 I get different results for my position/velocity when I use 2 steps of 20ms than when I use one step of 40ms. I used to have this problem for my position too, but adding +g*dt^2/2 to the formula for my position fixed the problem since it takes into account that the position depends on the velocity which changes slightly in every infinitely small time interval. Does something like that exist for air drag too? And no, I dont mean anything like Adding air drag to a golf ball trajectory equation or similar, for that kind of method only gives correct results when all my steps are the same. (I hope you can understand my intermediate english, it's not my main language so I would like to say sorry for all the silly mistakes I might have made in my question)

    Read the article

  • rotate player based off of joystick

    - by pengume
    Hey everyone I have this game that i am making in android and I have a touch screen joystick that moves the player around based on the joysticks position. I cant figure out how to also get the player to rotate at the same angle of the joystick. so when the joystick is to the left the players bitmap is rotated to the left as well. Maybe someone here has some sample code I could look at here is the joysticks class that I am using. `public class GameControls implements OnTouchListener { public float initx = DroidzActivity.screenWidth - 45; //255; // 320 og 425 public float inity = DroidzActivity.screenHeight - 45;//425; // 480 og 267 public Point _touchingPoint = new Point( DroidzActivity.screenWidth - 45, DroidzActivity.screenHeight - 45); public Point _pointerPosition = new Point(DroidzActivity.screenWidth - 100, DroidzActivity.screenHeight - 100); // ogx 220 ogy 150 private Boolean _dragging = false; private boolean attackMode = false; @Override public boolean onTouch(View v, MotionEvent event) { update(event); return true; } private MotionEvent lastEvent; public boolean ControlDragged; private static double angle; public void update(MotionEvent event) { if (event == null && lastEvent == null) { return; } else if (event == null && lastEvent != null) { event = lastEvent; } else { lastEvent = event; } // drag drop if (event.getAction() == MotionEvent.ACTION_DOWN) { if ((int) event.getX() > 0 && (int) event.getX() < 50 && (int) event.getY() > DroidzActivity.screenHeight - 160 && (int) event.getY() < DroidzActivity.screenHeight - 0) { setAttackMode(true); } else { _dragging = true; } } else if (event.getAction() == MotionEvent.ACTION_UP) { if(isAttackMode()){ setAttackMode(false); } _dragging = false; } if (_dragging) { ControlDragged = true; // get the pos _touchingPoint.x = (int) event.getX(); _touchingPoint.y = (int) event.getY(); // Log.d("GameControls", "x = " + _touchingPoint.x + " y = " //+ _touchingPoint.y); // bound to a box if (_touchingPoint.x < DroidzActivity.screenWidth - 75) { // og 400 _touchingPoint.x = DroidzActivity.screenWidth - 75; } if (_touchingPoint.x > DroidzActivity.screenWidth - 15) {// og 450 _touchingPoint.x = DroidzActivity.screenWidth - 15; } if (_touchingPoint.y < DroidzActivity.screenHeight - 75) {// og 240 _touchingPoint.y = DroidzActivity.screenHeight - 75; } if (_touchingPoint.y > DroidzActivity.screenHeight - 15) {// og 290 _touchingPoint.y = DroidzActivity.screenHeight - 15; } // get the angle setAngle(Math.atan2(_touchingPoint.y - inity, _touchingPoint.x - initx) / (Math.PI / 180)); // Move the ninja in proportion to how far // the joystick is dragged from its center _pointerPosition.y += Math.sin(getAngle() * (Math.PI / 180)) * (_touchingPoint.x / 70); // og 180 70 _pointerPosition.x += Math.cos(getAngle() * (Math.PI / 180)) * (_touchingPoint.x / 70); // make the pointer go thru if (_pointerPosition.x > DroidzActivity.screenWidth) { _pointerPosition.x = 0; } if (_pointerPosition.x < 0) { _pointerPosition.x = DroidzActivity.screenWidth; } if (_pointerPosition.y > DroidzActivity.screenHeight) { _pointerPosition.y = 0; } if (_pointerPosition.y < 0) { _pointerPosition.y = DroidzActivity.screenHeight; } } else if (!_dragging) { ControlDragged = false; // Snap back to center when the joystick is released _touchingPoint.x = (int) initx; _touchingPoint.y = (int) inity; // shaft.alpha = 0; } } public void setAttackMode(boolean attackMode) { this.attackMode = attackMode; } public boolean isAttackMode() { return attackMode; } public void setAngle(double angle) { this.angle = angle; } public static double getAngle() { return angle; } }` I should also note that the player has animations based on when he is moving or attacking. EDIT: I got the angle and am rotating the sprite around in the correct angle however it rotates on the wrong spot. My sprite is one giant bitmap that gets cut into four pieces and only one shown at a time to animate walking. here is the code I am using to rotate him right now. ` public void draw(Canvas canvas,int pointerX, int pointerY) { Matrix m; if (setRotation){ // canvas.save(); m = new Matrix(); m.reset(); // spriteWidth and spriteHeight are for just the current frame showed //m.setTranslate(spriteWidth / 2, spriteHeight / 2); //get and set rotation for ninja based off of joystick m.preRotate((float) GameControls.getRotation()); //create the rotated bitmap flipedSprite = Bitmap.createBitmap(bitmap , 0, 0,bitmap.getWidth(),bitmap.getHeight() , m, true); //set new bitmap to rotated ninja setBitmap(flipedSprite); setRotation = false; // canvas.restore(); Log.d("Ninja View", "angle of rotation= " +(float) GameControls.getRotation()); } ` And then the draw method // create the destination rectangle for the ninjas current animation frame // pointerX and pointerY are from the joystick moving the ninja around destRect = new Rect(pointerX, pointerY, pointerX + spriteWidth, pointerY + spriteHeight); canvas.drawBitmap(bitmap, getSourceRect(), destRect, null);

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >