Search Results

Search found 7799 results on 312 pages for 'changing'.

Page 1/312 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Java - Tile engine changing number in array not changing texture

    - by Corey
    I draw my map from a txt file. Would I have to write to the text file to notice the changes I made? Right now it changes the number in the array but the tile texture doesn't change. Do I have to do more than just change the number in the array? public class Tiles { public Image[] tiles = new Image[5]; public int[][] map = new int[64][64]; private Image grass, dirt, fence, mound; private SpriteSheet tileSheet; public int tileWidth = 32; public int tileHeight = 32; Player player = new Player(); public void init() throws IOException, SlickException { tileSheet = new SpriteSheet("assets/tiles.png", tileWidth, tileHeight); grass = tileSheet.getSprite(0, 0); dirt = tileSheet.getSprite(7, 7); fence = tileSheet.getSprite(2, 0); mound = tileSheet.getSprite(2, 6); tiles[0] = grass; tiles[1] = dirt; tiles[2] = fence; tiles[3] = mound; int x=0, y=0; BufferedReader in = new BufferedReader(new FileReader("assets/map.dat")); String line; while ((line = in.readLine()) != null) { String[] values = line.split(","); for (String str : values) { int str_int = Integer.parseInt(str); map[x][y]=str_int; //System.out.print(map[x][y] + " "); y=y+1; } //System.out.println(""); x=x+1; y = 0; } in.close(); } public void update(GameContainer gc) { } public void render(GameContainer gc) { for(int x = 0; x < map.length; x++) { for(int y = 0; y < map.length; y ++) { int textureIndex = map[y][x]; Image texture = tiles[textureIndex]; texture.draw(x*tileWidth,y*tileHeight); } } } Mouse picking public void checkDistance(GameContainer gc) { Input input = gc.getInput(); float mouseX = input.getMouseX(); float mouseY = input.getMouseY(); double mousetileX = Math.floor((double)mouseX/tiles.tileWidth); double mousetileY = Math.floor((double)mouseY/tiles.tileHeight); double playertileX = Math.floor(playerX/tiles.tileWidth); double playertileY = Math.floor(playerY/tiles.tileHeight); double lengthX = Math.abs((float)playertileX - mousetileX); double lengthY = Math.abs((float)playertileY - mousetileY); double distance = Math.sqrt((lengthX*lengthX)+(lengthY*lengthY)); if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON) && distance < 4) { System.out.println("Clicked"); if(tiles.map[(int)mousetileX][(int)mousetileY] == 1) { tiles.map[(int)mousetileX][(int)mousetileY] = 0; } } System.out.println(tiles.map[(int)mousetileX][(int)mousetileY]); }

    Read the article

  • Custom UITableViewCell changing indexPath While Scrolling ?

    - by Chris
    I have a custom UITableViewCell which I created in Interface Builder. I am successfully Dequeuing cells, but as I scroll, the cells appear to begin calling different indexPaths. In this example, I am feeding the current indexPath.section and indexPath.row into the customCellLabel. As I scroll the table up and down, some of the cells will change. The numbers can be all over the place, but the cells are not skipping around visually. If I comment out the if(cell==nil), then the problem goes away. If I use a standard cell, the problem goes away. Ideas why this might be happening? // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"CalendarEventCell"]; if (cell == nil) { NSLog(@"Creating New Cell !!!!!"); NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CalendarEventCell" owner:self options:nil]; cell = (UITableViewCell *)[nib objectAtIndex:0]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } // Set up the cell... [customCellLabel setText:[NSString stringWithFormat:@"%d - %d",indexPath.section, indexPath.row]]; return cell; }

    Read the article

  • changing sounds when objects meet

    - by blacksheep
    i'd like to change sounds when tapping on an image and drag another image over several others. it is not working properly: the "MoveImage" is not dragable, the tapping is working outside the "TouchImage" and the sounds do not change when tapping on it. (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if(((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_1.frame)))) { [sound_E play]; } if (((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_2.frame)))) { [sound_F play]; } if (((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_3.frame)))) { [sound_D play]; } if (((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_4.frame)))) { [sound_Dis play]; } } (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if (CGRectContainsPoint(myMoveImage.frame, location)){ CGPoint yLocation = CGPointMake(myMoveImage.center.x,location.y); myMoveImage.center = yLocation; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_1.frame)) { E_NOTE.text = @"E"; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_2.frame)) { F_NOTE.text = @"F"; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_3.frame)) { D_NOTE.text = @"D"; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_4.frame)) { Dis_NOTE.text = @"D#"; } }

    Read the article

  • dynamically changing the selector text

    - by kelly
    I have a 'next' button which fades out a div, shows another, changes out a graphic and then... I want it to change the actual ID of the 'next' button but neither .html nor replaceWith seem to be working. I have this: $(document).ready(function(){ $('#portfolio').fadeTo(500,0.25); $('#account') .animate({width:"10.1875em",height:"11.1875em",duration:'medium'}); $('#next2_btn').click(function(){ $('#content').fadeTo(300, 0.0, function() { $('#content2').show(300, function() { $('#next2_btn').$('#next2_btn'.value).html('<area shape="rect" coords="826,935,906,971" id="next3_btn" href="#">') $('#account').fadeTo(500,1.0) .animate({marginLeft:"220px", width:"2em",'height' :"2em",duration:'medium'}) .animate({     marginLeft:"400px",     marginTop:"35px",     width:"7em",     height:"7em", duration:"medium"     }, 'medium', 'linear', function() {     $('#statusGraphic').replaceWith('<img src="state2_138x28.gif">');     }) .fadeTo(500,0.5); $('#portfolio') .fadeTo(500,1.5) .animate({marginLeft:"-175px", width:"2em",height:"2.5em",duration:'medium'}) .animate({marginLeft:"-330px", width:"8.5em",height:"9.9375em",duration:'medium'}); }); }) })

    Read the article

  • Converting a constantly changing scalar value to a changing interval or frequency

    - by eco_bach
    Although I'm coding in Objective C, this is more of a general programming question. What is the best way to convert a constantly changing scalar value to a changing interval or frequency? Right now every time the scalar value changes I am destroying the NSInterval ie [self.myTimer invalidate]; self.myTimer = nil; and creating a new one, but this seems like a VERY expensive way to achieve my goal, since the changing scalar value in my case represents the horizontal velocity of a swipe. For a rough analogy, think of the speed of a swipe being reflected in a visual metronome, the faster you swipe, the higher(shorter interval) the frequency of the metronome.

    Read the article

  • IE8 v8 not changing class for a DOM element despite JS function changing the element attribute

    - by Alfabravo
    I have an on-screen keyboard in order to provide a safer input for passwords. The keyboard itself is placed like this: <div class="teclado_grafico" id="teclado_grafico"> <a class="tecla_teclado" onmousedown="teclaAction( this, 'caja_selector'); return false" style="top: 0px; left: 0px;">Q</a> <a class="tecla_teclado" onmousedown="teclaAction( this, 'caja_selector'); return false" style="top: 0px; left: 28px;">W</a> . . . </div> And it has a "Shift button" which fires a JS function with this (I've already tried all that, indeed): if (obj.innerHTML == "Mayus.") { try { MAYUSCULA_ACTIVADO = !MAYUSCULA_ACTIVADO; var tgrafico = document.getElementById("teclado_grafico"); if(MAYUSCULA_ACTIVADO) { // tgrafico.className = "teclado_grafico mayuscula"; // $("#teclado_grafico").removeClass('minuscula').addClass('mayuscula'); // $("#teclado_grafico").attr('class', 'teclado_grafico mayuscula'); // $("#teclado_grafico").attr('className', 'teclado_grafico mayuscula'); tgrafico.setAttribute('className', "teclado_grafico mayuscula") || tgrafico.setAttribute('class', "teclado_grafico mayuscula"); } else { // tgrafico.className = "teclado_grafico minuscula"; // $("#teclado_grafico").removeClass('mayuscula').addClass('minuscula'); // $("#teclado_grafico").attr('class', 'teclado_grafico minuscula'); // $("#teclado_grafico").attr('className', 'teclado_grafico minuscula'); tgrafico.setAttribute('className', "teclado_grafico minuscula") || tgrafico.setAttribute('class', "teclado_grafico minuscula"); } } catch (_E) { //void } return; } The associated CSS is like this: .mayuscula a.tecla_teclado{ text-transform: uppercase; } .minuscula a.tecla_teclado{ text-transform: lowercase; } It works on every single browser I've tried. IE 6, 7; Opera 10; GChrome; FF 3, 3.5 and 3.6; Safari 4,... but in IE8 v8 (strict mode) the class is not changed! I mean, debuggin' with the IE8 tools allows one to see that the attribute className is there and it changes... but the user does not see the letters changing from uppercase to lowercase, to uppercase again. I just don't know how to handle this... I had complains about the client using IE6... now they updated their stuff and this shows up. Any help will be reaaaaly helpful!

    Read the article

  • Changing timezone without changing time in Java

    - by Martin
    Hi! I'm receiving a datetime from a SOAP webservice without timzone information. Hence, the Axis deserializer assumes UTC. However, the datetime really is in Sydney time. I've solved the problem by substracting the timezone offset: Calendar trade_date = trade.getTradeDateTime(); TimeZone est_tz = TimeZone.getTimeZone("Australia/Sydney"); long millis = trade_date.getTimeInMillis() - est_tz.getRawOffset(); trade_date.setTimeZone( est_tz ); trade_date.setTimeInMillis( millis ); However, I'm not sure if this solution also takes daylight saving into account. I think it should, because all operations are on UTC time. Any experiences with manipulating time in Java? Better ideas on how to solve this problem?

    Read the article

  • Dynamically changing background color of specific text without changing other attributes

    - by gsingh2011
    I've written a chrome extension to find text on a page based on a regex query. When text is matched, I wrap the matched text in a <span> tag that has the class highlight where highlight only changes the background color to yellow. The issue is that sometimes there are already styles applied to <span> tags in a webpage. For example, the webpage might have this defined: span { font-size: 200%; } So when I insert my <span> tag in another <span> tag, the font-size is actually 400%. Is there an easy way for my code to just change certain properties of the text, like the background color, without applying the webpage's styles twice?

    Read the article

  • Prevent Changing the Screen Saver and Wallpaper in Windows 7

    - by Mysticgeek
    Sometimes you might not want users to have the ability to change Screen Savers and Wallpaper on Windows 7 workstations. Today we look at how to prevent them from changing either one or both. You might administer computers in your home or small office and find it annoying when users continuously change the wallpaper and Screen Savers to something obnoxious. A lot of times they might be inexperienced users and download these so-called “wonderful and free” Screen Saver/Wallpaper packages from shady sites that include loads of Spyware. Preventing users from changing them is another helpful tool to avoid wasteful time spent switching things back. Prevent Changing Screensavers & Wallpaper Using Group Policy Editor  Note: This method uses Group Policy which is not available in Home versions on Windows 7. Open the Start Menu and enter gpedit.msc into the Search box and hit Enter. When Local Group Policy Editor opens, navigate to User Configuration \ Administrative Templates \ Control Panel \ Personalization. Then in the right column double-click on Prevent changing desktop background. Now check the radio button next to Enabled, then click OK. Back on the Group Policy Screen, double-click on Prevent changing screen saver. In the next screen select the radio button next to Enable, click OK, then close out of Group Policy Editor. Now when a user goes into the Personalization section, the Desktop Background hyperlink is now grayed out and inactive. Notice the message One or more of the settings on this page has been disabled by the system administrator at the bottom of the section. If they click to change the Screen Saver, an error message will pop up letting them know the function is disabled. Prevent Changing Screensavers & Wallpaper Using a Registry Hack You can also make a couple Registry changes to prevent users from changing the Wallpaper & Screen Saver…which will work on Home versions of Windows 7. Before making any Registry changes make sure you back it up first. Open the Registry by typing regedit into the Search box in the Start menu and hit Enter. First we’ll start with the Wallpaper. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System and create a new String Value and name it Wallpaper. Then modify the Value data to point to the location of the Wallpaper you want it to always be. Where in this example it’s our main wallpaper on our local drive…then click OK. Now let’s make sure they can’t change the Screen Saver. In the same Registry location, we need to make a new DWORD (32-bit) Value. Give it the Value name of NoDispScrSavPage and the value data of “1” and click OK. Close out of the Registry and restart the machine or simply log off then back on again for the changes to take effect. Results For the Wallpapers, a user can still go in and see the selections, however if they try to change it to something else… It will just go back to the Personalization screen and no changes will be made, as we set the value to only be the background we specified. If the user tries to make a change to the Screen Saver, the hyperlink will be grayed out and inactive, and the message One or more of the settings on this page has been disabled by the system administrator will be displayed at the bottom of the section. Conclusion If you’re tired of users changing the Wallpaper and Screen Saver, and want another way to help avoid Malware, locking down these settings can help a lot. Again, before making any changes to the Registry, make sure to back it up. These settings should work in Vista and XP as well. Similar Articles Productive Geek Tips Save 1-4% More Battery Life With Windows Vista Battery SaverCustomize Your Windows Vista Logon ScreenEnable "Ubuntu Style" Logons in Windows VistaManage the Delete Confirmation Dialog box in Windows 7Dual Monitors: Use a Different Wallpaper on Each Desktop TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Acronis Online Backup DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows Fun with 47 charts and graphs Tomorrow is Mother’s Day Check the Average Speed of YouTube Videos You’ve Watched OutlookStatView Scans and Displays General Usage Statistics How to Add Exceptions to the Windows Firewall Office 2010 reviewed in depth by Ed Bott

    Read the article

  • Managing Slowly Changing Dimension with MERGE Statement in SQL Server

    Slowly Changing Dimension (SCD) Transformation is a quick and easy way to manage smaller slowly changing dimensions but it has several limitations and does not perform well when the number of rows or columns gets larger. Arshad Ali explores some of the alternatives you can use for managing larger slowly changing dimensions. How to automate your .NET and SQL Server deploymentsDeploy .NET code and SQL Server databases in a single repeatable process with Red Gate Deployment Manager. Start deploying with a 28-day trial.

    Read the article

  • Game Changing Features in the Silverlight 5 Beta (Part 3)

    - by mbcrump
    Introduction In the second part of my “Game-changing Features” series, I investigated how to create multiple windows in a trusted Silverlight 5 application. Now, it is time to explore another set of features: SoundEffect Class for Low-Latency, Supporting Double- and Triple-Mouse Clicks and Linked Text Containers.  If you followed my previous tutorial, then you should be ready to get started. The full source code for all three of the projects will be available as a separate download with this article. The full article is hosted on SSWUG and you can access it by clicking here. Don’t forget to rate it and leave comments if you have any problems. Other Resources by Me: My webinar on “Getting started with the Silverlight 5 Beta”. Getting Started with the Silverlight 5 Beta! Game Changing Features in the Silverlight 5 Beta (Part 1) Game Changing Features in the Silverlight 5 Beta (Part 2) Game Changing Features in the Silverlight 5 Beta (Part 3)  Subscribe to my feed

    Read the article

  • PowerPivot and the Slowly Changing Dimensions

    - by AlbertoFerrari
    Slowly changing dimensions are very common in the data warehouses and, basically, they store many versions of the same entity whenever a change happens in the columns for which history needs to be maintained. For example, the AdventureWorks data warehouse has a type 2 SCD in the DimProduct table. It can be easily checked for the product code “FR-M94S-38” which shows three different versions of itself, with changing product cost and list price. This is exactly what we can expect to find in any data...(read more)

    Read the article

  • PowerPivot and the Slowly Changing Dimensions

    - by AlbertoFerrari
    Slowly changing dimensions are very common in the data warehouses and, basically, they store many versions of the same entity whenever a change happens in the columns for which history needs to be maintained. For example, the AdventureWorks data warehouse has a type 2 SCD in the DimProduct table. It can be easily checked for the product code “FR-M94S-38” which shows three different versions of itself, with changing product cost and list price. This is exactly what we can expect to find in any data...(read more)

    Read the article

  • Changing in pavucontrols tab "Recording" via command line

    - by Mojo
    I'm using pavucontrol to make changes in the "Recording". I'm changing the source (??) of a Loopback to Null-Output from "Internes Audio Analog Stereo" to "Monitor of Internes Audio Analog Stereo" see the screenshot http://picpaste.de/Bildschirmfoto_vom_2013-10-26_11_32_03-z0KwnFDE.png I'm now looking for a possibility to do this via command line. So far I've done the following: pactl load-module module-null-sink ? creates a new sink pactl load-module module-loopback ? creates a new sink input pactl load-module module-loopback ? creates another sink input pacmd move-sink-input 0 1 ? changes the sink of the sink-input (to Null-Output); this is like changing manually in the pacucontrol tab "Playback". It's just the last part (making the change like shown in the screenshot) via command line that I'm not able to do. I'd be very happy for any advice or suggestions. Thanks already!

    Read the article

  • Changing the material on an object on click in unity

    - by user1509674
    Iam working on unity2d.I have six game object Object1,Object1,Object1,(these are images) ObjectImage1,ObjectImage2,ObjectImage3(these are images). I have arranged the object in the scene as a list one below another Object1 Object2 Object3 When I click the Object1 --- should change to ObjectImage1 Object2 ----should change to ObjectImage2, but the above image of object1(objectImage1) at present should change to Object1 Object3 ----? should change to ObjectImage3,but the above image on object2(objectImage2) should change to Object2 These is similar to selection.I have coded Like when I click of Object2 its changing to ObjectIamge2 but the first object is not changing to object1 from objectImage1.Can anybody help me coding it out. Edit: public GameObject newSprite; private Vector3 currentSpritePosition; void Start() { newSprite.renderer.enabled = false; currentSpritePosition = transform.position; //then make it invisible renderer.enabled = false; //give the new sprite the position of the latter newSprite.transform.position = currentSpritePosition; //then make it visible newSprite.renderer.enabled = true; } void OnMouseExit(){ //just the reverse process renderer.enabled = true; newSprite.renderer.enabled = false; } This is the code used to change the material: public GameObject newSprite; private Vector3 currentSpritePosition; void Start(){ newSprite.renderer.enabled = false; } void OnMouseEnter(){ //getting the current position of the current sprite if ever it can move; currentSpritePosition = transform.position; //then make it invisible renderer.enabled = false; //give the new sprite the position of the latter newSprite.transform.position = currentSpritePosition; //then make it visible newSprite.renderer.enabled = true; } void OnMouseExit(){ //just the reverse process renderer.enabled = true; newSprite.renderer.enabled = false; }

    Read the article

  • Changing website Url - Am I making an SEO mistake

    - by Denis
    I have a webiste with a .com domain that is a year old. The business is a shop based in Ireland and I have purchased a .ie domain. I plan to move the website over to the new domain, SEO Good or Bad idea? Old Url - SmythsOfTerenure.com | New Url - SmythsComputerRepair.ie (I am using Fake names and fictional business in the example Url's) The new domain has my main keyword in it. The old domain has my family name and business location (city district) It currently ranks high for lots of relevant keywords in Google with low traffic and low competition. Current website traffic is about 80 session per week. 80% of that traffic is Organic from Google. I am changing domain in an attempt to help SEO long term by having a CC TLD (.ie rather than .com) and having my main Keyword in the domain. I plan to do 301 re-directs from old to new and update GW Tools and G Analytics but am I making a mistake changing it at all as I know rankings may fall in the sort term. Homepage PR=0 and very few inbound links. Should I just leave it on the old domain? Or after a few months should I be back up ranking as well as I am now?

    Read the article

  • Times they are a changing…

    - by Jonathan Kehayias
    If you follow me on twitter ( @SQLSarg ), you already know that this has been a week of big announcements for me. Wednesday afternoon Paul Randal ( Blog | Twitter ) announced that I joined SQLskills.com as a full time employee, and Thursday afternoon, Joe Sack ( Blog | Twitter ) announced that I passed the Microsoft Certified Masters for SQL Server 2008 . As a part of my transition to working for SQLskills.com full time, I will be changing blogs over to the SQLskills.com site. You can read about...(read more)

    Read the article

  • changing default text input on nexus 7 ubuntu to bluetooth keyboard

    - by user101764
    i was curious if it was possible to use a logitech bluetooth keyboard for android 4.0+ with ubuntu on nexus 7? i was able to connect the keyboard regularly with the gui, the pin worked, so i would assume it is a matter of changing the default text input. i searched all of the settings i could find without finding any such option any help would be appreciated, if this is not possible feel free to say so and close this thread

    Read the article

  • Slowly Changing Dimensions handling in PowerPivot (and BISM?)

    - by Marco Russo (SQLBI)
    During the PowerPivot Workshop in London we received many interesting questions and Alberto had the inspiration to write this nice post about Slowly Changing Dimensions handling in PowerPivot. It is interesting the consideration about SCD Type I attributes in a SCD Type II dimension – you can probably generate them in a more dynamic way in PowerPivot (thanks to Vertipaq and DAX) instead of relying on a relational table containing all the data you need, which usually requires a more complex ETL process....(read more)

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >