|
  
|
|
|||||||
| Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Zuner
Join Date: May 2008
Posts: 64
Reputation: 11
|
Is it possible to read from a text file on the Zune for maps and the like? I tried to port a game over that did, but I had to manually input the map to a string array because traditional file io did not work.
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#2 (permalink) |
|
Developper
Experienced Zuner
Join Date: May 2008
Location: Qu�bec, Canada!
Posts: 104
Reputation: 25
|
You can read a .txt file.. if you create it first
So reading is only good for save games really..
__________________
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. My website is down! Temporary download link : To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Feel free to contact me to get my msn/gtalk address if you develop games, I love to help and I know a lot about programming! To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. ![]() |
|
|
|
|
|
#4 (permalink) | |
|
zB Programmer
Experienced Member Join Date: Mar 2007
Posts: 975
Reputation: 119
|
Quote:
![]() |
|
|
|
|
|
|
#6 (permalink) |
|
Zewbie
Join Date: Jun 2008
Posts: 1
Reputation: 10
|
I tried the txt file input using the properties settings specified by SimReality, and what I'm getting is an Unauthorized Access Exception or something along those lines. Anyone have any thoughts?
I can't paste the exact error in here currently as I am not at home with the code. But basically I've got the txt file with the properties setup, I'm using a StreamReader to read in the txt file. What I was thinking was that was where the problem was. Any help is appreciated. Last edited by myerspa : 06-04-2008 at 07:22 AM. ![]() ![]() |
|
|
|
|
|
#7 (permalink) |
|
Jr. Member
Join Date: May 2008
Posts: 410
Reputation: 60
|
You probably did:
StreamReader reader = new StreamReader("MyFile.txt"); which won't work on the Zune (or 360). They have no concept of a current directory nor can they use relative paths. What you need to do is add in the TitleLocation to get the full directory: StreamReader reader = new StreamReader(Path.Combine(StorageContainer.TitleLo cation, "MyFile.txt")); |
|
|
|
|
|
#9 (permalink) |
|
Jr. Member
Join Date: May 2008
Posts: 410
Reputation: 60
|
But turning text into JPEGs is a giant waste of space. You are going to blow up the size of the text and then lose all the flexibility of changing fonts or sizes or arrangement at runtime. It's much better to simply load in the text as text and then handle drawing it.
|
|
|
|
![]() |
| Thread Tools | |
|
|
| |