Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderReaper7 committed Nov 13, 2019
2 parents 1f16903 + 36398df commit d8163ab
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 3 deletions.
7 changes: 7 additions & 0 deletions PartiAppen/PartiAppen/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
/processorParam:TextureFormat=Compressed
/build:Fonts/Main.spritefont

#begin Fonts/Small.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Compressed
/build:Fonts/Small.spritefont

#begin Fonts/Sub.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
Expand Down
60 changes: 60 additions & 0 deletions PartiAppen/PartiAppen/Content/Fonts/Small.spritefont
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">

<!--
Modify this string to change the font that will be imported.
-->
<FontName>Roboto-bold</FontName>

<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>6</Size>

<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>

<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>

<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>

<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->

<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#996;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
31 changes: 28 additions & 3 deletions PartiAppen/PartiAppen/MenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public Menues State

public int MenuesAmount => Enum.GetNames(typeof(Menues)).Length;

// A variable for resetting the scroll
int scrollReturn;

// Create menu pages
Menu menu = new Menu(Enum.GetNames(typeof(Menues)).Length);

Expand All @@ -47,6 +50,8 @@ public void LoadMenu(ContentManager content)
SpriteFont titleFont = content.Load<SpriteFont>(@"Fonts/Title");
SpriteFont subFont = content.Load<SpriteFont>(@"Fonts/Sub");
SpriteFont textFont = content.Load<SpriteFont>(@"Fonts/Text");
SpriteFont smallFont = content.Load<SpriteFont>(@"Fonts/Small");


// Color theme
Color primary = new Color(3,169,244), primaryLight = new Color(103,218,255), primaryDark = new Color(0,122,193);
Expand Down Expand Up @@ -197,6 +202,8 @@ public void LoadMenu(ContentManager content)

#endregion

menu.Pages[(int)Menues.Program].AddText(titleFont, new Vector2(720/2, -100), true, "*DAB*", Color.Black);

menu.Pages[(int)Menues.Program].AddImageButton(new ImageButton(backArrowWhite, new Rectangle(new Point(720/2-45, yOffSet + 1800), new Point(80)), logoBlue, logoYellow, () => SetMenuState(Menues.Menu)));


Expand Down Expand Up @@ -230,12 +237,23 @@ public void LoadMenu(ContentManager content)
+ "Anton Gunnarsson & " + System.Environment.NewLine
+ "Arvid Rimmerfors", Color.Black);

menu.Pages[(int)Menues.OmOss].AddImageButton(new ImageButton(backArrowWhite, new Rectangle(new Point(720 / 2 - 45, 920), new Point(80)), logoBlue, logoYellow, () => SetMenuState(Menues.Menu)));


#endregion

#region Press
menu.Pages[(int)Menues.Press].AddText(titleFont, new Vector2(720 / 2, 80), true, "Press", Color.Black);

menu.Pages[(int)Menues.Press].AddText(subFont, new Vector2(720 / 2, 200), true, "Musik", Color.Black);
menu.Pages[(int)Menues.Press].AddText(textFont, new Vector2(720 / 2, 240), true, "shorturl.at/foyVX", Color.Black);


menu.Pages[(int)Menues.Press].AddText(subFont, new Vector2(720 / 2, 340), true, "Logo", Color.Black);
menu.Pages[(int)Menues.Press].AddText(textFont, new Vector2(720 / 2, 380), true, "shorturl.at/lnxKR", Color.Black);


menu.Pages[(int)Menues.Press].AddText(smallFont, new Vector2(5, 1065), false, "*DAB*", Color.Black);


#endregion
}

Expand Down Expand Up @@ -269,7 +287,14 @@ public void Update()
break;
case Menues.Program:
// move camera
Game1.camera.Position = new Vector2(Game1.camera.Position.X, Game1.camera.Position.Y + (deltaScroll * scrollMultiplier));
if (Game1.camera.Position.Y < -100)
{
scrollReturn++;
}
else if (Game1.camera.Position.Y < 0)
scrollReturn = 2;
else scrollReturn = 0;
Game1.camera.Position = new Vector2(Game1.camera.Position.X, MathHelper.Clamp(Game1.camera.Position.Y + scrollReturn + (deltaScroll * scrollMultiplier), -200, 1000) );
break;
case Menues.OmOss:
// reset camera
Expand Down

0 comments on commit d8163ab

Please sign in to comment.