Pagina 2 di 3 primaprima 1 2 3 ultimoultimo
Visualizzazione dei risultati da 11 a 20 su 23
  1. #11
    Utente di HTML.it
    Registrato dal
    Jul 2012
    Messaggi
    9
    Originariamente inviato da rsdpzed
    carica un altra risorsa (un altro file png) e prova a fare il load di quella
    Provato l'effetto è lo stesso cambia solo il colore di sfondo dell'imagine (ho provato con un'immagine bianca e viene bianco l'effetto)

  2. #12
    Utente di HTML.it L'avatar di rsdpzed
    Registrato dal
    Aug 2001
    Messaggi
    764
    a questo punto non lo so, forse è una questione tutta legata all'emulatore / configurazione del tuo pc (direct x ecc). Oggi pomeriggio mi scarico sia xna su questo pc che l'applicazione che stai provando tu e faccio una prova

  3. #13
    Utente di HTML.it
    Registrato dal
    Jul 2012
    Messaggi
    9
    Originariamente inviato da rsdpzed
    a questo punto non lo so, forse è una questione tutta legata all'emulatore / configurazione del tuo pc (direct x ecc). Oggi pomeriggio mi scarico sia xna su questo pc che l'applicazione che stai provando tu e faccio una prova
    Dici che mi conviene disinstallare l'emulatore e reinstallarlo?

  4. #14
    Utente di HTML.it L'avatar di escocat
    Registrato dal
    Feb 2012
    Messaggi
    308
    Il codice funziona, se c'è un problema è nella touchCollection che ho de-commentato ed impostato io una posizione per il logo

    codice:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Audio;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.GamerServices;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    //using Microsoft.Xna.Framework.Input.Touch;
    using Microsoft.Xna.Framework.Media;
    
    namespace WindowsPhoneGame1
    {
        /// <summary>
        /// This is the main type for your game
        /// </summary>
        public class Game1 : Microsoft.Xna.Framework.Game
        {
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;
            Texture2D logoTexture;
            Vector2 logoPosition;
    
            public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";
    
                // Frame rate is 30 fps by default for Windows Phone.
                TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
            }
    
            /// <summary>
            /// Allows the game to perform any initialization it needs to before starting to run.
            /// This is where it can query for any required services and load any non-graphic
            /// related content.  Calling base.Initialize will enumerate through any components
            /// and initialize them as well.
            /// </summary>
            protected override void Initialize()
            {
                // TODO: Add your initialization logic here
    
                base.Initialize();
            }
    
            /// <summary>
            /// LoadContent will be called once per game and is the place to load
            /// all of your content.
            /// </summary>
            protected override void LoadContent()
            {
                // Create a new SpriteBatch, which can be used to draw textures.
                spriteBatch = new SpriteBatch(GraphicsDevice);
    
                // TODO: use this.Content to load your game content here
                logoTexture = Content.Load<Texture2D>("logo");
    
                Viewport viewport = graphics.GraphicsDevice.Viewport;
                logoPosition = new Vector2(
                    (viewport.Width - logoTexture.Width) / 2,
                    (viewport.Height - logoTexture.Height) / 2);
            }
    
            /// <summary>
            /// UnloadContent will be called once per game and is the place to unload
            /// all content.
            /// </summary>
            protected override void UnloadContent()
            {
                // TODO: Unload any non ContentManager content here
            }
    
            /// <summary>
            /// Allows the game to run logic such as updating the world,
            /// checking for collisions, gathering input, and playing audio.
            /// </summary>
            /// <param name="gameTime">Provides a snapshot of timing values.</param>
            protected override void Update(GameTime gameTime)
            {
                // Allows the game to exit
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                    this.Exit();
    
                // TODO: Add your update logic here
                /*TouchCollection touchCollection = TouchPanel.GetState();
                if (touchCollection.Count > 0)
                {
                    TouchLocation t1 = touchCollection[0];
    
                    double x = t1.Position.X - (logoPosition.X + (logoTexture.Width / 2));
                    double y = t1.Position.Y - (logoPosition.Y + (logoTexture.Height / 2));
                    double speed = Math.Sqrt(x * x + y * y) / 20;
    
                    double angle = (float)Math.Atan2(y, x);
    
                    logoPosition.X += (float)(speed * Math.Cos(angle));
                    logoPosition.Y += (float)(speed * Math.Sin(angle));
                }*/
    
                base.Update(gameTime);
            }
    
            /// <summary>
            /// This is called when the game should draw itself.
            /// </summary>
            /// <param name="gameTime">Provides a snapshot of timing values.</param>
            protected override void Draw(GameTime gameTime)
            {
                GraphicsDevice.Clear(Color.Black);
    
                // TODO: Add your drawing code here
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
                spriteBatch.Draw(logoTexture, Vector2.Zero, Color.White);
                spriteBatch.End();
    
                base.Draw(gameTime);
            }
        }
    }

  5. #15
    Utente di HTML.it L'avatar di escocat
    Registrato dal
    Feb 2012
    Messaggi
    308
    Anzi no, funziona tutto, ho aggiunto il riferimento a Microsoft.Xna.Framework.Input.Touch dala voce "References" nella Finestra soluzioni. Forse è il tuo logo che dà problemi....

  6. #16
    Utente di HTML.it L'avatar di escocat
    Registrato dal
    Feb 2012
    Messaggi
    308
    Perfetto. Ho provato anche il tuo logo e funziona alla grande! Almeno nel mio portatilino....

  7. #17
    Utente di HTML.it
    Registrato dal
    Jul 2012
    Messaggi
    9
    Originariamente inviato da escocat
    Perfetto. Ho provato anche il tuo logo e funziona alla grande! Almeno nel mio portatilino....
    io penso a questo punto sia un problema di pc... Lo formatto e riprovo che ti devo dire asd

  8. #18
    Utente di HTML.it L'avatar di escocat
    Registrato dal
    Feb 2012
    Messaggi
    308
    Hai provato con un altro logo, una piccola bitmap magari 10x10?

  9. #19
    Utente di HTML.it
    Registrato dal
    Jul 2012
    Messaggi
    9
    Originariamente inviato da escocat
    Hai provato con un altro logo, una piccola bitmap magari 10x10?
    qualunque cosa provo sempre lo stesso risultato con colori diversi

  10. #20
    Utente di HTML.it L'avatar di escocat
    Registrato dal
    Feb 2012
    Messaggi
    308
    Prova a creare lo stesso progetto usando il "template" Windows Game 4.0 anzichè WindowsPhone....non si sa mai (sto provando a indovinare.... )

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.