Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 792 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
create a text during runtime/pointer autodetection, object types #352293
01/02/11 19:18
01/02/11 19:18
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
hi everybody,

have got the following problem:
I am using txt_create to create a text during runtime eg
Code:
TEXT *mytext = txt_create(30, 10);//create lokal text pointer


1. but how do I copy a string into the text object and using a font?
I tried:
txt_addstring --> didnt work
2. can I use flag-assignments for text objects like
Code:
set (mytext, SHOW);




SECOND PROBLEM:
since last week I ve been using visual c++ and some problem have appeared:
- does pointer autodedection mean that I dont have to dereference like ENTITY->x?
- I think I roughly understand how pointers work for numerical objects like double, int, etc, eg:
Code:
#include <iostream>  
using namespace std; 

double a = 4, *b;

int main()
{
   cout << b;//00000000, no storage location the pointer points to
   //cout << *b;//would crah because b points at no object, no storage location can be read out
   cout << a;//4
   b = &a;
   cout << b;//now b contains the storage location of a
   cout *b;//4, now I have access to the numerical value of a
}



but how does it work for self defined structs/new data types like ENTITY?
- ENTITY *myent allocates a free storage location
- but where is the "real" ENTITY (the storage location) the ENTITY pointer points at?

THANKS IN ADVANCE!!




Last edited by MPQ; 01/02/11 23:53.

new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: how to create a text during runtime [Re: MPQ] #352295
01/02/11 19:20
01/02/11 19:20
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
1) What? That did not work?

Works here without a problem wink

Font: mytext.font = yourFont; or mytext.font = font_create("Arial#24");

2. Yes

Re: how to create a text during runtime [Re: Rei_Ayanami] #352327
01/02/11 22:07
01/02/11 22:07
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
thanks texts are running great on now, but maybe sbody can help me with my other questions



Last edited by MPQ; 01/03/11 23:23.

new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1