• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

Changing the main menu position

kimono

Well-known member
Hi Openbor users,

I'm wondering if there is a simple way to change the position the writings of the main menu?
The main menu is centered by default but for some title screen, it can be better at the left, right upper or below side of the screen.

Thanks for your attention and your help to customize this main screen :) .
 
@Scarlet Lupercalia: Thanks, I already took a look and I saw that this game uses White Dragon TMNT Shell Shocked scripts that mixes animated title screen and some other custom features. I'm searching an easier way to change the coords of this menu. If not, I need to extract the part of code that mentions each option in this script.
 
There's no way to modify main menu position.

The other way is to use scripted menu. I don't know what White Dragon did in his module but in Scorer Horror, main menu is skipped and player 1 starts in a level acting as main menu.
 
Hi Openbor users,

I'm wondering if there is a simple way to change the position the writings of the main menu?
The main menu is centered by default but for some title screen, it can be better at the left, right upper or below side of the screen.

Thanks for your attention and your help to customize this main screen :) .
@kimono

I don't know if it will work for your game, but a simple way to change the native menu positions is by using the translation.txt file, like the example below.
Even if it's a simple way, you will have some work to translate and align every menu text.

uM4bhNb.png


msgid "Options"
msgstr "Options__________________________________________________________________________"
msgid "Start Game"
msgstr "Start Game__________________________________________________________________________"
 
@Bloodbane: Thanks for taking a look at this topic. Here's a screenshot of Burning Fox main screen that uses White Dragon script:
jRZtGcY.png

The updated.c script a little complicated because it uses some animations:
Code:
//scripted var
#define    TITLE_TEXT 1        //1
#define    CURSORSPR1 2        //2
#define    CURSORSPR2 3        //3
#define    CURSORSPR3 4        //4
#define    TITLE_LOOPS 5        //5
#define    LOADINGSPR 6        //6
#define GAMEINIT 7        //6
#define    TOTALANIFRAME 297    //297
#include "data/scripts/define.h"
#include "data/scripts/traileru.c"
#include "data/scripts/biStory.c"
#include "data/scripts/movelist.c"
#include "data/scripts/lifebar.c"
#include "data/scripts/gettick.c"
#include "data/scripts/common/file.c"
void test()
{
    //void a=allocscript("a");
    //log(a);
    //loadscript(a,"data/scripts/aa.txt");
    //compilescript(a);
    //setglobalvar("a",a);

}
void getZoomScr()
{
    void zoom_scr = getindexedvar(ZOOM_SCR);
    if(!zoom_scr){
        zoom_scr = allocscreen(480,272);
        setindexedvar(ZOOM_SCR,zoom_scr);
    }
    return zoom_scr;
}
void zoom()
{
    void vscreen,rot;
    void zoom_scr = getZoomScr();
    void maxz=openborvariant("PLAYER_MAX_Z");
    void zoom_value=getindexedvar(ZOOM_VALUE);
    void ent=getindexedvar(ZOOM_ENT);
    void px=getentityproperty(ent,"x") - openborvariant("xpos");
    void py=getentityproperty(ent,"z") - openborvariant("ypos") - getentityproperty(ent,"a");
    clearscreen(zoom_scr);
    zoom_value+=get_tick()*1.5;
    if(!zoom_value)zoom_value=256;

    if(zoom_value>420){
        setindexedvar(ZOOM_VALUE,256);
        setindexedvar(ZOOM_SWI,0);
        return;
    }

    setindexedvar(ZOOM_VALUE,zoom_value);
    //Draw all elements to customized screen,range z from min_int to player_max_z+500,x=0,y=0

    drawspriteq(zoom_scr,0,1,maxz+1,0,0);
    //drawspriteq(zoom_scr,0,openborconstant("MIN_INT"),openborconstant("MAX_INT"),0,0);
    //Set drawMethod
    changedrawmethod(NULL(),"reset",1);
    changedrawmethod(NULL(),"enabled",1);
    if(zoom_value>384)zoom_value=384;
    changedrawmethod(NULL(),"scalex",zoom_value);
    changedrawmethod(NULL(),"scaley",zoom_value);
    changedrawmethod(NULL(),"centerx",px);
    changedrawmethod(NULL(),"centery",py);
    //Draw the resized customized screen to main screen.
    drawscreen(zoom_scr,px,py, maxz+1);
    changedrawmethod(NULL(),"enabled", 0);

    void vscreen = openborvariant("vscreen");

    drawspriteq(vscreen, 0, maxz+1,maxz+1, 0, 0);
    //drawspriteq(vscreen, 0, openborconstant("MIN_INT"),openborconstant("MAX_INT"), 0, 0);
    clearspriteq();
}
void main()
{
    mainLoop();
    setscriptvar(GLOBAL_LASTTICK,openborvariant("elapsed_time"));
}
void loadSaveData()
{
    void cc=loadSetting("save.s");
    setlocalvar("clearCount",cc);
    setglobalvar("clearCount",cc);
    setglobalvar("inv",loadSetting("inv.cfg"));
    setlocalvar("difficulty",1);
}
void loadTitleAni()
{
    void i,j;
    void titleani=getindexedvar(TITLE_ANI);
    if(!titleani)
    {
        test();
        loadSaveData();
        log("loading title background sprites...\n");
        titleani=array(TOTALANIFRAME);
        for(i=0;i<TOTALANIFRAME;i++)
        {
            set(titleani,i,loadsprite("data/bgs/wormhole/"+i+".gif"));
        }
        setindexedvar(TITLE_ANI,titleani);
        setlocalvar("tscr",allocscreen(400,64));
        setlocalvar("ttextm",loadsprite("data/bgs/ttextm.gif"));
        setlocalvar("ttextbgl",loadsprite("data/bgs/ttextbgl.gif"));
        setlocalvar("tscr1",allocscreen(400,64));

        setscriptvar(TITLE_TEXT,loadsprite("data/bgs/ttext.gif"));
        setlocalvar("ttextbg",loadsprite("data/bgs/ttextbg.gif"));
        log("loading cursors...\n");
        void handle;
        for(i=1;i<4;i++)
        {
            for(j=1;j<5;j++)
            {
                handle=loadsprite("data/bgs/cursor/p"+i+j+".gif");
                setlocalvar("cursor.p"+i+j,handle);
            }
        }
    }
    //executescript(getglobalvar("a"));
}
void inCompleteLoop()
{
    int i;
    void completeani=getindexedvar(COMPLETE_ANIM);
    if(!completeani)
    {
        log("loading complete background sprites...\n");
        completeani=array(111);
        for(i=0;i<111;i++)
        {
            set(completeani,i,loadsprite("data/bgs/complete/sc"+i+".gif"));
        }
        setindexedvar(COMPLETE_ANIM,completeani);
    }
    setdrawmethod(NULL(),1,256,256,0,0,0,1);
    drawsprite(get(completeani,openborvariant("elapsed_time")%1100/10),138,34,50,0);
    setdrawmethod(NULL(),0,256,256,0,0,0,0);
}
void inTitleLoop(int distitle)
{

    void loadingspr=getscriptvar(LOADINGSPR);
    if(!getscriptvar(TITLE_LOOPS)){
        loadingspr=loadsprite("data/bgs/loadinga.gif");
        drawsprite(loadingspr,0,0,COVER_Z);
        setscriptvar(LOADINGSPR,loadingspr);
        setscriptvar(TITLE_LOOPS,1);
    }else{
        if(loadingspr){
            free(loadingspr);
            setscriptvar(LOADINGSPR,NULL());
        }
        loadTitleAni();
        void titleani=getindexedvar(TITLE_ANI);
        void time=openborvariant("elapsed_time");
        void spr=get(titleani,time%(TOTALANIFRAME*10)/10);
        void scr=getlocalvar("tscr");
        void scr1=getlocalvar("tscr1");
        void clearCount,ptitle,difficulty;
        drawsprite(spr,0,0,1);
        if(distitle){
            drawspritetoscreen(getlocalvar("ttextbgl"),scr,time%600,0);
            drawspritetoscreen(getlocalvar("ttextbgl"),scr,time%600 - 600,0);
            drawspritetoscreen(getlocalvar("ttextm"),scr,0,0);
            drawspritetoscreen(getlocalvar("ttextbg"),scr1,-time%500,0);
            drawspritetoscreen(getlocalvar("ttextbg"),scr1,-time%500 + 500,0);
            drawspritetoscreen(getscriptvar(TITLE_TEXT),scr1,0,0);

            setdrawmethod(NULL(),1,256,256,0,0,0,0,0,0,0,0,1);
            drawscreen(scr,40,22,21);
            setdrawmethod(NULL(),1,256,256,0,0,0,1);
            drawscreen(scr1,40,22,21);
            setdrawmethod(NULL(),0,256,256,0,0,0,0);
            drawstring(400,258,0,"Version 2.41");
            clearCount=getglobalvar("clearCount");
            drawstring(18,258,0,"Clear Count "+clearCount);
            difficulty=getlocalvar("difficulty");
            if(difficulty==4){
                ptitle="Expert";
            }else if(difficulty==3){
                ptitle="Very Hard";
            }else if(difficulty==2){
                ptitle="Hard";
            }else if(difficulty==1){
                ptitle="Normal";
            }else{
                ptitle="Easy";
            }
            
            drawstring(182,258,1,"Difficulty "+ptitle);
            if(difficulty>0)drawstring(170,258,6,"B");
            if(difficulty<4)drawstring(304,258,6,"F");
        }
    }
}
void inSelectLoop()
{
    void i;
    void selectback=getlocalvar("select.bg");
    void selectbg1=getlocalvar("select.bg1");
    void selectbg2=getlocalvar("select.bg2");
    void selecttext=getlocalvar("select.text");
    void selecttext2=getlocalvar("select.text2");
    void selectg=getlocalvar("select.profile");
    void time=openborvariant("elapsed_time")*0.8;
    if(!selectg){
        selectg=loadsprite("data/bgs/cursor/selectg.gif");
        setlocalvar("select.profile",selectg);
    }
    if(!selecttext){
        selecttext=loadsprite("data/bgs/selectt1.gif");
        setlocalvar("select.text",selecttext);
    }
    if(!selecttext2){
        selecttext2=loadsprite("data/bgs/selectt2.gif");
        setlocalvar("select.text2",selecttext2);
    }
    //setdrawmethod(NULL(),1,256,256,0,0,0,1);
    drawsprite(selecttext,-time%363,2,7);
    drawsprite(selecttext,-time%363+363,2,7);
    drawsprite(selecttext,-time%363+726,2,7);
    drawsprite(selecttext2,time%538,112,7);
    drawsprite(selecttext2,time%538 - 538,112,7);
    //setdrawmethod(NULL(),0,256,256,0,0,0,0);

    //---------------------------------------------------------
    void swi=getlocalvar("selectg.swi");
    void scale=getlocalvar("selectg.scale");
    void rotate=getlocalvar("selectg.rotate");
    changedrawmethod(NULL(),"enabled",1);

    if(!swi){
        scale -= get_tick()*4;
        rotate+=get_tick()*5.8;
        if(scale<=256){
            scale=256;
            setlocalvar("selectg.swi",1);
            rotate=0;
            setlocalvar("selectg.rotate",0);
        }
        setlocalvar("selectg.scale",scale);
        setlocalvar("selectg.rotate",rotate);
        rotate%=360;
        changedrawmethod(NULL(),"rotate",rotate);
        changedrawmethod(NULL(),"scalex",scale);
        changedrawmethod(NULL(),"scaley",scale);
    }

    //changedrawmethod(NULL(),"watermode",1);   
    //changedrawmethod(NULL(),"amplitude",5);
    //changedrawmethod(NULL(),"wavelength",10);
    //changedrawmethod(NULL(),"wavespeed",1);
    //changedrawmethod(NULL(),"wavetime",openborvariant("elapsed_time"));

    changedrawmethod(NULL(),"centerx",174);
    changedrawmethod(NULL(),"centery",40);
    //changedrawmethod(NULL(),"watermode",3);
    //changedrawmethod(NULL(),"beginsize",1);
    //changedrawmethod(NULL(),"endsize",2);
    //changedrawmethod(NULL(),"perspective",1);
    
    //----------------------------------------------------------
    drawsprite(selectg,240,73,13);
    changedrawmethod(NULL(),"enabled",0);
    if(swi)
    {
        if(openborvariant("current_stage")<3)
        {
            drawbox(375,74,37,36,14,0,0);
        }
        if(getglobalvar("clearCount")<1)
        {
            drawbox(298,74,37,36,14,0,0);
        }
        if(swi)drawCursor();
    }
    inTitleLoop(0);
}

void drawCursor()
{
    void i;
    for(i=0;i<3;i++)drawCursor1(i,i*160+80);
}
void drawCursor1(void index,void xx)
{
    void x,y;
    if(position(getglobalvar("select."+xx+".name"),xx)){
        x=getlocalvar("cursor."+xx+".x");
        y=getlocalvar("cursor."+xx+".y");
        if(x!=NULL()&&y!=NULL()){
            drawDCursor(index,x,y);
        }
    }
}
void drawDCursor(void index,void x,void y)
{
    index++;
    void pind=(openborvariant("elapsed_time")%120/30);
    pind++;
    void str="cursor.p"+index+pind;
    setdrawmethod(NULL(),1,256,256,0,0,0,6);
    drawsprite(getlocalvar(str),x,y,51,0);
    setdrawmethod(NULL(),0,256,256,0,0,0,0);
    drawsprite(getlocalvar("cursor.p"+index+"1"),x,y,52,0);
}
void position(void name,void xp)
{
    void x,y;
    void y1=30,y2=69;
    if(name==NULL())return 0;
    if(name=="Ken"){
        x=62;y=y1;
    }else if(name=="Terry"){
        x=101;y=y1;
    }else if(name=="Guy"){
        x=139;y=y1;
    }else if(name=="Zier"){
        x=177;y=y1;
    }else if(name=="Alex"){
        x=215;y=y1;
    }else if(name=="Dudley"){
        x=254;y=y1;
    }else if(name=="Akuma"){
        x=292;y=y1;
    }else if(name=="Rock"){
        x=330;y=y1;
    }else if(name=="Lee"){
        x=369;y=y1;
    }else if(name=="Mai"){
        x=62;y=y2;
    }else if(name=="Maki"){
        x=101;y=y2;
    }else if(name=="Hibiki"){
        x=139;y=y2;
    }else if(name=="Leona"){
        x=177;y=y2;
    }else if(name=="Kula"){
        x=215;y=y2;
    }else if(name=="Shiki"){
        x=254;y=y2;
    }else if(name=="Ingrid"){
        x=292;y=y2;
    }else if(name=="Morrigan"){
        x=330;y=y2;
    }else if(name=="Sarah"){
        x=369;y=y2;
    }else{
        x=-59;y=-69;
    }
    setlocalvar("cursor."+xp+".x",x);
    setlocalvar("cursor."+xp+".y",y);
    return 1;
}

void mainLoop()
{
    if(openborvariant("in_level"))
    {
        inGameLoop();
    }else if(openborvariant("in_titlescreen")){
        setlocalvar("selectg.swi",0);
        setlocalvar("selectg.scale",512);
        setlocalvar("selectg.rotate",0);
        difficultySelect();
        inTitleLoop(1);
    }else if(openborvariant("in_menuscreen")){
        difficultySelect();
        inTitleLoop(1);
        drawbox(0,0,480,272,3,0,6);
    }
    else if(openborvariant("in_selectscreen")){
        inSelectLoop();
        drawbox(0,0,480,272,3,0,6);
    }else if(openborvariant("in_showcomplete")){
        inCompleteLoop();
    }
}
void inGameLoop()
{   
    if(!getscriptvar(GAMEINIT))gameInit();
    if(openborvariant("game_paused"))
    {
        drawbox(0,0,480,272,3000,rgbcolor(0,0,0),6);
        return;
    }
    
    if(getindexedvar(ZOOM_SWI)){zoom();}else{}
    void i;
    void scr=getindexedvar(SCREEN);
    if(scr)clearscreen(scr);
    drawCurtain();
    turnWhite();
    lifeBar();
    afterImg();
    moveList();
    story();
    for(i=0;i<3;i++)disHp(i);
    if(scr)drawscreen(scr,0,0,2999,0);
}

void getPlayer(int index)
{
    return getplayerproperty(index,"ent");
}
void turnWhite()
{
    void dir=getindexedvar(WHITE);
    
    if(!dir){return;}else{}

    void tick=get_tick();
    void w=getglobalvar("white.alpha");
    if(!w)
    {
        if(dir==1)
        {
            w=0;
        }else{
            w=256;
        }
    }
    
    if(dir==1)
    {
        w+=tick*0.8;
    }else{
        w-=tick*0.8;
    }

    if(dir==1)
    {
        if(w>255)w=255;
    }else{
        if(w<0)w=0;
    }
    setglobalvar("white.alpha",w);
    drawbox(0,0,480,272,900,rgbcolor(w,w,w),1);
}
void pause()
{
    if(getindexedvar(PAUSE))return;
    spawnEnt("pause",0,0);
    setindexedvar(PAUSE,1);
}
void spawnEnt(void vName,void x,void z)
{
    clearspawnentry();
    setspawnentry("name", vName);
    void ent=spawn();
    changeentityproperty(ent,"position",x+openborvariant("xpos"),z+openborvariant("ypos"));
}
void gameInit()
{
    setglobalvar("difficulty",getlocalvar("difficulty"));
    setglobalvar("clearCount",getlocalvar("clearCount"));
    setscriptvar(GAMEINIT,1);
}
void drawCurtain()
{
    long width,tick,w,i;
    if(getindexedvar(CURTAIN)){
        if(getindexedvar(ENGAGE_SHOW)&&!getindexedvar(STORY_ENT)){
            if(!isFullScreenStory())spawnEnt("engage2",0,276);
            setindexedvar(ENGAGE_SHOW,0);
        }
    }else{
        tick=get_tick();
        w=getglobalvar("curtain.width");
        if(!w)w=0;
        w+=tick*0.8;
        setglobalvar("curtain.width",w);
        drawbox(0,0,480,272,COVER_Z,rgbcolor(w,w,w),2);
        if(w>254){
            setindexedvar(CURTAIN,1);
            setindexedvar(PAUSE,0);
        }else{
            pause();
        }
    }
}
long getHpColor(long hp)
{
    if(hp<=100){
        return HP1;
    }else if(hp>100){
        return HP2;
    }else if(hp>200){
        return HP3;
    }else if(hp>300){
        return HP4;
    }else if(hp>400){
        return HP5;
    }else if(hp>500){
        return HP6;
    }else if(hp>600){
        return HP7;
    }else if(hp>700){
        return HP8;
    }else if(hp>800){
        return HP9;
    }
}
void drawHpBarCount(void scr,void ind,void hp,void startx)
{
    void hp_count=hp*0.01;
    if(hp_count>=0)
        hp_count%=++hp_count;
    else
        hp_count=0;
    if(hp_count)drawstringtoscreen(scr,startx +83+ind*160,30,7,"x"+hp_count);

}
void getEnemyOldHp(void enemy)
{
    void enemyoldhp=getentityvar(enemy,ENT_OLDHP);
    if(enemyoldhp==NULL()){
        enemyoldhp=getentityproperty(enemy,"maxhealth");
        setentityvar(enemy,ENT_OLDHP,enemyoldhp);
    }
    return enemyoldhp;
}
void drawPlayerHp(void ent,void startx,void ind)
{
    void    hp        =    getentityproperty(ent,"health");
    void    pOldHp    =    getentityvar(ent,ENT_OLDHP);
    if (pOldHp==NULL())
    {
        pOldHp=getentityproperty(ent,"maxhealth");
        setentityvar(ent,ENT_OLDHP,pOldHp);
    }
    if(hp<0) hp=0; else {}
    void damage=pOldHp - hp;
    drawBar(startx+ind*160,21,hp,3,HP1);
    if(damage>0)
    {
        drawBar(startx+ind*160+hp,21,damage,3,255);
        pOldHp-=get_tick()*0.1;
        setentityvar(ent,ENT_OLDHP,pOldHp);
    }else if(damage<0){
        setentityvar(ent,ENT_OLDHP,hp);
    }
}
void disHp(void ind)
{
    void    ent        =    getplayerproperty(ind,"ent");
    if        (!ent)return;else{}
    void    scr        =    getindexedvar(SCREEN);
    void    startx    =    41;
    void    enemy    =    getentityproperty(ent,"opponent");
    long    hpcolor1,i,damage,damagex,hp_count,hp;

    drawPlayerHp(ent,startx,ind);

    if(enemy&&!getentityproperty(enemy,"nolife"))
    {
        void realhp=getentityproperty(enemy,"health");
        void enemyoldhp=getEnemyOldHp(enemy);
        hp=realhp;
        startx=37;
        drawHpBarCount(scr,ind,hp,startx);
        //Calculate the damage
        damage=enemyoldhp - realhp;
        //Get hp color and draw current hp
        hpcolor1=getHpColor(hp);
        if(hp>100)hp%=100;
        if(hp<0){
            damage+=hp;
            if(damage<0)damage=0;
            hp=0;
        }
        drawBar(startx+ind*160,25,hp,3,hpcolor1);
        //draw Enemy's Damage
        if(hp+damage>100)damage=100 - hp;
        damagex=hp+startx+ind*160;
        drawBar(damagex,25,damage,3,255);
        //
        void lasttick=getscriptvar(GLOBAL_LASTTICK);
        void am=lasttick - getentityvar(enemy,HP_TIME);
        if(am>0)
        {
            enemyoldhp-=am*0.5;
            setentityvar(enemy,HP_TIME,lasttick);
            if(enemyoldhp<realhp)enemyoldhp=realhp;
            setentityvar(enemy,ENT_OLDHP,enemyoldhp);
        }
    }else{}

    //drawMp
    void mp=getentityproperty(ent,"mp")*0.5;
    void drawF;
    
    if(mp==75){
        drawF=75;
    }else if(mp>=50){
        drawF=50;
    }else if(mp>=25){
        drawF=25;
    }else{
        drawF=0;
    }

    void drawmpcolor;
    if(mp>50){
        if(drawF==75){
            drawmpcolor=MPCOLOR1;
        }else{
            drawmpcolor=MPCOLOR2;
        }
        startx=83+ind*160;
        drawBar(startx,29,mp-50,2,drawmpcolor);
    }

    if(mp>50)mp=50;
    if(mp>25){
        if(drawF>=50){
            drawmpcolor=MPCOLOR1;
        }else{
            drawmpcolor=MPCOLOR2;
        }
        startx=58+ind*160;
        drawBar(startx,29,mp-25,3,drawmpcolor);
    }
    if(mp>25)mp=25;
    if(drawF>=25){
        drawmpcolor=MPCOLOR1;
    }else{
        drawmpcolor=MPCOLOR2;
    }
    startx=34+ind*160;
    drawBar(startx,29,mp,4,drawmpcolor);
    disMpFlow(ind,drawF);
}

void drawBar(void x,void y,void width,void height,void color)
{
    if(width<1){return;}else{}
    int i;
    void scr=getindexedvar(SCREEN);
    for(i=0;i<height;i++)
    {
        drawboxtoscreen(scr,x-i,y+i,width,1,color,0);
    }
}

void disMpFlow(void ind,long mp)
{
    if (!mp){return;}else{}
    void scr=getindexedvar(SCREEN);
    long pos=getlocalvar("mppos."+ind);
    long i,x,o;
    if(pos==NULL())pos=0;

    for(i=0;i<11;i++)
    {
        x=pos-i;
        if(x>50){
            o=2;
        }else if(x>25){
            o=1;
        }else{
            o=0;
        }
        if(x>=0&&x<mp-1){
            drawlinetoscreen(scr,34+ind*160+x,29,34+ind*160+x-3+o,32-o,rgbcolor((12-i)*20,233+(22-i*2),(12-i)*20),0);
        }
    }
    pos+=get_tick()*0.2;
    if(pos>100)pos=0;
    setlocalvar("mppos."+ind,pos);
}

Maybye I can try to extract all title and menu mentions from here.
I think that if we manage to make a simple script for the writing position, this opens a door for a lot of cool custom title scenes :).
The Burning Fox game for taking a look at this scene:

@Kratus: Your idea is brillant! I will use this trick by default, waiting for a better solution, thank you very much ;) .
 
msgid "Options"
msgstr "Options__________________________________________________________________________"
msgid "Start Game"
msgstr "Start Game__________________________________________________________________________"
I don't know how to to note the locations in there.
 
You can add \n (new line) and \t (tab) to translation strings as well. You'll need to do it for all the lines since the engine draws each separately, but it does work as an easy way to reposition text downward.

DC
 
msgid "Options"
msgstr "Options__________________________________________________________________________"
msgid "Start Game"
msgstr "Start Game__________________________________________________________________________"
how to make the "start game" downward?
I use enter and it shows "D" letter on every line
 
how to make the "start game" downward?
I use enter and it shows "D" letter on every line
Do you want to move only the "start game"? I don't know a way without changing the engine source code.
The script I posted only moves the entire menu, and by using the translation file you can change only the alignment.
 
Do you want to move only the "start game"? I don't know a way without changing the engine source code.
The script I posted only moves the entire menu, and by using the translation file you can change only the alignment.
Yes, I already change the msgid-msgstr in translation.txt but can I also downward the line?
sf89 - 0011_edit.png
 
Yes, I already change the msgid-msgstr in translation.txt but can I also downward the line?
In this case you will need to draw a scripted text once there's no way to move the native text downward. To erase the default text, you can use the translation file and put a "space" or any other letter that is empty in your font table.
 
I was thinking about this... did anyone tried to use translation file to make all main menu text empty, and then paste the text objects by script where they want on screen ?
Then hightlight /swap fonts of text objects based on up/down pressess ?
I think that would be simple solution that could work fine.
Or just spawn entity that has follow anims which will highlight the proper menu choice.
msgid "Start Game"
msgstr "_"

msgid "Options"
msgstr "_"

msgid "How To Play"
msgstr "_"

msgid "Hall Of Fame"
msgstr "_"

msgid "Quit"
msgstr "_"
 
Last edited:
I was thinking about this... did anyone tried to use translation file to make all main menu text empty, and then paste the text objects by script where they want on screen ?
Then hightlight /swap fonts of text objects based on up/down pressess ?
I think that would be simple solution that could work fine.
Or just spawn entity that has follow anims which will highlight the proper menu choice.
msgid "Start Game"
msgstr "_"

msgid "Options"
msgstr "_"

msgid "How To Play"
msgstr "_"

msgid "Hall Of Fame"
msgstr "_"

msgid "Quit"
msgstr "_"
The SORX "level select", "survival" and "endings" menu currently works this way, I was developing some kind of "skin" for menus to fully customize it but didn't finish yet.
The concept is similar to your idea, it works by mapping all the menu options with scripts and then using drawstring to write every text.

Under the hood, the script detects every key press and memorizes everything in variables, this way the script will know exactly where you are and it's possible to apply any desired effect. Currently I only made it for the main menu, there's a huge amount of work remaining to include the entire "options" screen yet.

1717098920677.png

 
There is ton of work to make it work everywhere , i felt the tension today when i encountered various issues in various screens... yeah, id say not today.
+ if you want to do major overhaul for new game... its a ton of work again.
 
I want to move "PRESS START" downward.
It's possible by translation.txt ?
@betterbold It's not possible but you can write your own press start using the drawstring script function. Here's an example in the updated.c script event.

Code:
void pressStart()
{
    if(openborvariant("in_titlescreen"))
    {
        void text = "PRES START"; //CURRENT TEXT
        int hRes = openborvariant("hresolution"); //GET X SCREEN RESOLUTION
        int vRes = openborvariant("vresolution"); //GET Y SCREEN RESOLUTION
        int font = 0; //CURRENT FONT USED FOR TEXTS
        int x = (hRes/2) - (strwidth(text, font)/2); //TEXT AUTOMATICALLY CENTERED IN X AXIS
        int y = vRes/2; //TEXT AUTOMATICALLY CENTERED IN Y AXIS
        int layer = openborconstant("MAX_INT"); //Z LAYER
        int delay = 100; //DELAY USED BY THE BLINK RATE
        int time = openborvariant("elapsed_time")/delay; //GET CURRENT TIME

        //ALTERNATE "PRESS START" TEXT ON THE SCREEN
        if(time%2 == 0)
        {
            drawstring(x, y, font, text, layer); //WRITE TEXT ON THE SCREEN
        }
    }
}

 
Back
Top Bottom